除了用流来传递Gif外,还有什么办法?procedure TFormDemo.ButtonLoadClick(Sender: TObject); var Stream : TStream; GIF : TGIFImage; begin // Do not use buffering. // This is safe since we have complete control over the TImage's canvas include(GIFImageDefaultDrawOptions, goDirectDraw); // Create a stream to load the GIF resource from Stream := TResourceStream.Create(hInstance, 'download', 'GIF'); try GIF := TGIFImage.Create; try // Load the GIF from the resource stream GIF.LoadFromStream(Stream); // Display the GIF in the TImage ImageGIF.Picture.Assign(GIF); finally GIF.Free; end; finally Stream.Free; end; end;
如果贴入后,如果吧RichEdit 中内容 保存到数据库后, 那么图片是不是夜保存了雅?
把代码贴出来好吗?
http://delphi.ur-solution.com/delphi_download/upload/30994_Delphi-RichEdit.rar
不过,想把richedit的内容保存到数据库,并不是你所想像的那样连图片也保存进去的,它本身毕竟不是一个文件或进行流处理,所以,图片保存是两回事。
RICHEDIT文档插入的图片应该是OLE插入方式,楼主先慢慢想想。。
var
Stream : TStream;
GIF : TGIFImage;
begin
// Do not use buffering.
// This is safe since we have complete control over the TImage's canvas
include(GIFImageDefaultDrawOptions, goDirectDraw); // Create a stream to load the GIF resource from
Stream := TResourceStream.Create(hInstance, 'download', 'GIF');
try
GIF := TGIFImage.Create;
try
// Load the GIF from the resource stream
GIF.LoadFromStream(Stream);
// Display the GIF in the TImage
ImageGIF.Picture.Assign(GIF);
finally
GIF.Free;
end;
finally
Stream.Free;
end;
end;