Dippen
asked on
Problem with TJPEGImage!
Hi!
Why doesn't the code below work? It displays test1.jpg just fine (Image1 is an TImage that is put at the form at design-time), but it refuses to display test2.jpg. Do I have to reset (in some way) or even DESTROY the TJPEGImage between these operations?
procedure TForm1.FormShow(Sender: TObject);
var
JPEG : TJPEGImage;
begin
JPEG := TJPEGImage.Create;
JPEG.LoadFromFile('\Temp\T est1.jpg') ;
Image1.Picture.Bitmap.Assi gn(JPEG);
//**************
JPEG.LoadFromFile('\Temp\T est2.jpg') ;
Image1.Picture.Bitmap.Assi gn(JPEG);
Image1.Repaint;
end;
All help appreciated!
Why doesn't the code below work? It displays test1.jpg just fine (Image1 is an TImage that is put at the form at design-time), but it refuses to display test2.jpg. Do I have to reset (in some way) or even DESTROY the TJPEGImage between these operations?
procedure TForm1.FormShow(Sender: TObject);
var
JPEG : TJPEGImage;
begin
JPEG := TJPEGImage.Create;
JPEG.LoadFromFile('\Temp\T
Image1.Picture.Bitmap.Assi
//**************
JPEG.LoadFromFile('\Temp\T
Image1.Picture.Bitmap.Assi
Image1.Repaint;
end;
All help appreciated!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Image1.Picture.Assign(JPEG
instead of
Image1.Picture.Bitmap.Assi