T O P I C R E V I E W |
johnrboren |
Posted - Oct 15 2012 : 12:22:21 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 |
2 L A T E S T R E P L I E S (Newest First) |
johnrboren |
Posted - Oct 17 2012 : 09:23:14 That worked great! Thank you!
JOHN BOREN |
Patrick Quinn |
Posted - Oct 16 2012 : 02:08:18 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 |
|
|