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
 Change Quality on Load
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

johnrboren

USA
12 Posts

Posted - Oct 15 2012 :  12:22:21  Show Profile  Reply
I have a form that has 18 small TImageENDBView objects. When I load the form, I'm loading each object with a photo from teh database, then assigning the graphic to the screen object.

Some of our users save multi-megabyte JPEG images. Loading 18 of those - we sometimes end up with an out-of-memory error.

Is there a way to change the quality and have it Load abide by that setting?

Both MyPic and ImageBuffer are TImageEnDBView objects. ImageBuffer is tied directly to the ADODataSet query, and the other is just on the screen, not tied to a database.

MyPic.IO.bitmap.assign( // Copy picture from image buffer
ImageBuffer.IO.bitmap); // component to gallery component


JOHN BOREN

Patrick Quinn

United Kingdom
81 Posts

Posted - Oct 16 2012 :  02:08:18  Show Profile  Reply
For thumbnails, try setting TIOJPEGScale to ioJPEG_HALF, ioJPEG_QUARTER or ioJPEG_EIGHTH.

ioJPEG_EIGHTH will load nearly 8 times faster and only use 12.5% of the memory of the full image. If the images are multi-megabyte the reduced quality shouldn't be apparent.

It might be simpler to use an ImageEnMView to show the image thumbnails. I posted a snippet of code that will fill one from a database at http://www.imageen.com/ieforum/topic.asp?TOPIC_ID=590

and there is a demo at http://www.imageen.com/demos/Database/DBMView/DBMView.zip

in your samples at /demos/Database/DBMView/DBMView.dpr

regards

Patrick
Go to Top of Page

johnrboren

USA
12 Posts

Posted - Oct 17 2012 :  09:23:14  Show Profile  Reply
That worked great! Thank you!

JOHN BOREN
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: