1
var
Streamalt, Streamalt2 : TStream;
Jpegalt, Jpegalt2 : TJPEGImage;
Bmpalt, Bmpalt2 : TBitmap;
begin
Streamalt := DMretaguarda.QConItem.CreateBlobStream(DMretaguarda.QConItemftpec1, bmRead);
try
Jpegalt := TJpegImage.Create;
Bmpalt := TBitmap.Create;
Jpegalt.LoadFromStream(Streamalt);
Bmpalt.Assign(Jpegalt);
ResizeBitMap(Bmpalt, FItem.foto1.Picture.Bitmap, FItem.foto1.Width, FItem.foto1.Height);
FItem.foto1.Visible := true;
Jpegalt.Free;
streamalt.free;
except
FItem.foto1.Visible := false;
Jpegalt.Free;
streamalt.free;
end;
end;
The following code is to read an image in the database (mysql), and play it on a Timage.
What I want, is to treat this same field to check if it is empty, and if it is empty, do not send anything to my Timage.
If the Delphi version is >= 7, you can make use of Unit
JPeg
in the form, may place on it aTDBImage
and connected directly to the field, avoiding all this code.– AlexSC