Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JPEG image loading trouble

Status
Not open for further replies.

mirodel

Technical User
Aug 4, 2002
7
BG
Hi,
When i put a TImage component on my form and assign a jpg image of about 200KB it displays it too slowly.(that's for a P2 200Mhz). Is there any other way to put it into the memory before displaying it on the screen? Any suggestions?
 
You could try setting the Timage.visible to false and then
assign the jpeg. set the .visible property true afterwards
at some point.

This will not really speed up the process, but you won't
see it happening and then the image will just be there on
a refresh. So psychologically it appears to load faster.


Scotto the Unwise
 
You can try to do it like this:
Code:
var
  AJpg : TJPEGImage;
begin
  AJpg := TJPEGImage.Create;
  AJpg.LoadFromFile('c:\MyJPegImage.jpg');
  AImage.Picture.Graphic := AJpg; // AImage is an instance of TImage.
end;

--- markus




 
Thanks very much!!!
I found out that a BMP image is loaded much faster than a JPG image and I think that the problem could be solved if I use LoadFromFile and open a BMP image. That way the huge BMP image won't be imported into my EXE fail.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top