ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 ParamFromBuffer
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

sandy771

57 Posts

Posted - Mar 08 2013 :  15:39:16  Show Profile  Reply
What params does it actually get?

I am trying to get the dimensions (x and y pixels) and the number of colours in a file.

xequte

39142 Posts

Posted - Mar 09 2013 :  12:31:26  Show Profile  Reply
Hi

It will fill the "Params" property of the TImageEnIO:

http://www.imageen.com/help/TImageEnIO.Params.html


So you can then access:

ImageEnIO1.Params.Width
ImageEnIO1.Params.Height
ImageEnIO1.Params.BitsPerSample
ImageEnIO1.Params.SamplesPerPixel

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

sandy771

57 Posts

Posted - Mar 11 2013 :  15:32:53  Show Profile  Reply
Thanks Nigel

In that case I am seeing some very odd behaviour - perhaps you can select some light on it.

I have a loop which loads data from a series of files into a buffer and then attempts to get the x and y pixel count.

essentially

do{
ReadFile(buf, filesize);
IO->LoadFromBuffer(buf, filesize, ioUnknown);
nextfile;
}

If I do the above then LoadFromBuffer works (gets the correct x & Y pixel counts), but after a few hundred (it varies) iterations my program hangs

If I replace LoadFromBuffer with LoadParamsFromBuffer then the program doesnt hang but I get the same pixel count for every file.

if i comment out loadfrombuffer/loadparamsfrombuffer the program rusn OK - so something is a miss either in ImaegEn or is causing ImageEn to hang.

I am calling ImageEn in a thread and I pass a TImageEnView object to it from the calling (main) process - I am not sure if this is where the issue is, and I dont know (have not tried to see) whether I can create a timageenview that does not attach to a visual component.

Any ideas?

Thanks
Go to Top of Page

fab

1310 Posts

Posted - Mar 12 2013 :  11:14:17  Show Profile  Reply
quote:
I am calling ImageEn in a thread and I pass a TImageEnView object to it from the calling (main) process - I am not sure if this is where the issue is, and I dont know (have not tried to see) whether I can create a timageenview that does not attach to a visual component.


You should create (and destroy) the TImageEnView inside your thread. Actually, if you only need to get Width and Height you could use only TImageEnIO.ParamsFromBuffer (still creating/destroying TImageEnIO inside the thread).
Go to Top of Page

sandy771

57 Posts

Posted - Mar 12 2013 :  11:20:25  Show Profile  Reply
Thanks fabrizio - I'll give that a go.

I will probably want to get at exif data at some point a swel...
Go to Top of Page

sandy771

57 Posts

Posted - Mar 13 2013 :  08:59:48  Show Profile  Reply
That worked fabrizio - thanks
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: