How to show jpg image from MemoryStream
November 28th, 2006 By krastev
If you want to present jpg image from Memorystream you can use this procedure in Delphi:
procedure TfmMain.ShowImage(ImageName:String; ImageStr:TMemoryStream; var Image:TImage);
var Graphic:TGraphic;
ImageType:String;
begin
if ImageStr.Size <= 1 then
Exit;
try
ImageType := UPPERCase(ExtractFileExt(ImageName));
if (ImageType = '.JPG') OR (ImageType = '.JPEG') then
graphic := TJpegImage.Create;
ImageStr.Position := 0;
graphic.LoadFromStream(ImageStr);
Image.Picture.Assign(graphic);
finally
graphic.Free;
end;
end;
Last 5 posts by krastev
- Same World - March 7th, 2008
- General Photography Images - February 10th, 2008
- What animal would you like to be - June 13th, 2007
- The internet is for communication - May 22nd, 2007
- How to lose weight quickly - May 21st, 2007
Popularity: 32% [?]








