请求支援:如何在RxRichEdit或RichView中显示Gif动画。(100分)

  • 主题发起人 主题发起人 l-vision
  • 开始时间 开始时间
L

l-vision

Unregistered / Unconfirmed
GUEST, unregistred user!
如题,在RxRichEdit或RichView好像只能显示图片,不能显示Gif动画。请问如何实现以上所提功能。
注:分不够另开帖加。
 
没有回答啊。
 
好像不行,我试过了
 
你也想做msn吗
 
用webbrower
 
function PictureToBitmap(const picFileName: string; Bitmap: TBitmap): TBitmap;
var
vIcon: TIcon;
Graphic: TPicture;
begin
Result := Bitmap;
Graphic := TPicture.Create;
try
Graphic.LoadFromFile(picFileName);
if Graphic.Graphic is TBitmap then
begin
Bitmap.Assign(Graphic.Bitmap);
end
else if Graphic.Graphic is TIcon then
begin
vIcon := TIcon.Create;
vIcon.LoadFromFile(picFileName);
Bitmap.Height := vIcon.Height;
Bitmap.Width := vIcon.Width;
Bitmap.Canvas.Draw(0, 0, vIcon);
vIcon.Free;
end
else
begin
Bitmap.Assign(Graphic.Graphic);
end;
finally
FreeAndNil(Graphic);
end;
end;

procedure InsPicIntoRxre(const RxRichEdit: TRxRichEdit);
var
Bitmap: TBitmap;
op: TOpenDialog;
fn: string;
begin
op := TOpenDialog.Create(nil);
Bitmap := TBitmap.Create;
with op do
try
if not Execute then
exit;
fn := op.FileName;
Clipboard.Assign(PictureToBitmap(fn, Bitmap));
RxrichEdit.PasteFromClipboard;
finally
FreeAndNil(Bitmap);
Free;
end;
end;
 
to goddy:
是的,不过只是公司一个产品里的一个集成而以。

to BrainYang:
谢谢你的答复,你的代码只是实现插入图片的吧?我这边现在存在的问题是想在RichView中显示Gif动画。
 
to sbzldlb:
不考虑用webbrower啦。[:D]
 
没错,可以插入gif图片。
如果你的意思是让gif动画动起来,我想应该是插入Object才对,这倒是个问题。
 
to BrainYang:
谢谢。我是想让Gif能动起来。呵呵
 
另外,请教各位另一个问题。
在RxRichEdit中,为何我设定字体变粗或斜体等等Font.Style时都无效,请问是什么问题。
 
1.安装QQ后就有ImageOle.dll。
这种贴子在历来Delphibbs的chm版中就有。
其中2005版有一篇文章《如何在RichEdit中显示动态的Gif图象?》,也许可以解决楼主的问题。
搜索"插入gif"。
2005版地址, http://downloads.2ccc.com/tools/help/app2001_delphibbs_20050101-20051231_CHM.rar

2.怎么会无效呢
rxRichEdit1.SelAttributes.Style := rxRichEdit1.SelAttributes.Style + [fsItalic]; //斜体
 
谢谢。问题解决了。发分啦。
 
多人接受答案了。
 
后退
顶部