Re: Once and for all! Fastest way to load large jpeg
- From: jimbo@xxxxxxxxxx
- Date: 13 Dec 2006 21:42:50 -0800
My program is a kiosk for viewing and ordering digital images and is
reading external drives so the program is always working from cd or usb
that's why the premium on loading large images. Cameras are producing
larger photos. Media can hold hundreds of photos. I have to display a
reasonable sized image for inspection so when the thumb is clicked I
load from the media.
Right, so the photos are all different, that rules out caching.
Sorry. Still confused.
If you are just reading the file once, then 'remembering' it is not
going to help much.
Understood.
<snip>
How about kicking off a separate App that generates the thumbnails in
the back ground, that way you'll be using the processor while the user
is twiddling with the mouse.
The thumbs are no problem.
<snip>
<snip>User chooses folder from directorylistbox populating a filelistbox.
I create an object for each entry with path and other relevant info and
add it to an array with a common index to the filelistbox. So I use
whichever is convenient.
Where exactly are those JPEGs coming from
CD USB or any external drive.
How long do you want to keep the JPEGs
In practice only long enough to assign it to the larger TImage. I free
it immediately. See original example.
Could you explain the 4mb
- do you mean that a 4mb file is slow to load ?
Yes from external media. I orginally tested with 2MB files from various
cameras. When I started testing with larger 4MB+ files the speed is
borderline acceptable. I need to improve loading the image from disk
somehow in order to properly support large files.
If that is the case, you could try reading the entire file into a
memory stream and then use LoadFromStream
- I'm not sure, but it could cut down on physical disk reads
I found this. Would this help?
var
bm2: TBitmap;
st: TMemoryStream;
begin
bm2:= TBitmap.Create;
bm2.PixelFormat := pf24bit;
bm2.Width := 256 ;
bm2.Height := 256 ;
st := TMemoryStream.Create;
bm2.SaveToStream (st);
st.Seek( - (256*256*3), soFromEnd);
st.WriteBuffer( ColorArray[ScrollPos,0,0,1] , 256*256*3);
st.Seek(0, soFromBeginning );
bm2.LoadFromStream(st);
Image1.Picture.Bitmap := bm2;
bm2.Destroy ;
st.Destroy;
end;
Jim
.
- Follow-Ups:
- Re: Once and for all! Fastest way to load large jpeg
- From: J French
- Re: Once and for all! Fastest way to load large jpeg
- References:
- Once and for all! Fastest way to load large jpeg
- From: jimbo
- Re: Once and for all! Fastest way to load large jpeg
- From: J French
- Re: Once and for all! Fastest way to load large jpeg
- From: jimbo
- Re: Once and for all! Fastest way to load large jpeg
- From: J French
- Re: Once and for all! Fastest way to load large jpeg
- From: jimbo
- Re: Once and for all! Fastest way to load large jpeg
- From: J French
- Re: Once and for all! Fastest way to load large jpeg
- From: jimbo
- Re: Once and for all! Fastest way to load large jpeg
- From: J French
- Once and for all! Fastest way to load large jpeg
- Prev by Date: Re: Feature Warning Request: Possible loss of data
- Next by Date: Re: (geen onderwerp)
- Previous by thread: Re: Once and for all! Fastest way to load large jpeg
- Next by thread: Re: Once and for all! Fastest way to load large jpeg
- Index(es):
Relevant Pages
|