var
MyStream:TMemoryStream;
MyBitMap:TBitMap;
MyJpeg:TJpegImage;
MyJpeg:=TJpegimage.Create;
Mystream :=TMemoryStream.Create;
MyBitMap:=TBitMap.create;
try
QueryImage.savetostream(MyStream);
MyStream.Seek(0,soFromBeginning);
Myjpeg.loadfromstream(MyStream);
MyBitMap.Assign(MyJpeg);
//.....
.....
finally
MyJpeg.Free;
MyStream.Free;
MyBitMap.Free;
end;