Delphi 2007 中的动画 GIF 和 TDrawgrid
我可以使用类似下面的代码来绘制图像:
ACanvas.Draw(ARect.Left+16, ARect.Top+4, imgGIF.Picture.Graphic )
现在正在通过
GIF := TGifImage.Create;
GIF.LoadFromFile('path\to\gif\processing.gif');
GIF.Animate := True;
imgGIF.Picture.Graphic.Assign(GIF);
我设置
GIFImageDefaultAnimate := True;
GIFImageDefaultTransparent := True;
加载该 imgGIF 组件的 gif环境是 Delphi 2007,使用 Delphi 2007 DVD 附带的 TGifImage。 这可能吗?要在 TDrawgrid 单元格上显示动画 GIF?
我不认为这是因为canvas.draw只是绘制图像,而不是将组件插入到单元格中 - 所以据我所知,它只是在gif上绘制固定图像。
I am being able to draw the image using something like the code below:
ACanvas.Draw(ARect.Left+16, ARect.Top+4, imgGIF.Picture.Graphic )
Now the gif for that imgGIF component is being loaded via
GIF := TGifImage.Create;
GIF.LoadFromFile('path\to\gif\processing.gif');
GIF.Animate := True;
imgGIF.Picture.Graphic.Assign(GIF);
I am setting
GIFImageDefaultAnimate := True;
GIFImageDefaultTransparent := True;
The environment is Delphi 2007, using the TGifImage that comes with the Delphi 2007 DVD.
Is this even possible? To display an animated GIF on a TDrawgrid Cell?
I don't think it is since canvas.draw is only drawing the image, not inserting the component into the cell - so as far as I can understand, it is only drawing the firm image on the gif.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当
TGIFImage.Animate
设置为True时,调用Canvas.Draw()
将渲染动画的当前帧。当TGIFImage
放置在TImage
内时,TImage
使用TGraphic.OnChange
事件自动重绘最新帧当动画运行时。要使用TDrawGrid
执行相同的操作,您必须定期调用Canvas.Draw()
,例如在间隔设置为Canvas.Draw()
的值的计时器中。代码>TGIFImage.FrameDelay 属性。否则,将 GIF 图像加载到单独的TGIFImage
实例中以供TDrawGrid
使用,以便您可以利用TGraphic.OnChange
事件。When
TGIFImage.Animate
is set to True, callingCanvas.Draw()
will render the current frame of the animation. When theTGIFImage
is placed inside aTImage
,TImage
uses theTGraphic.OnChange
event to automatically redraw the latest frame as the animation is running. To do the same thing with theTDrawGrid
, you will have to callCanvas.Draw()
periodically, such as in a timer whose interval is set to the value of theTGIFImage.FrameDelay
property. Otherwise, load the GIF image into a separateTGIFImage
instance for theTDrawGrid
's use so you can utilize theTGraphic.OnChange
event.