我使用了this control,但它不支持GIF文件格式,因为图片不像PictureBox
那样移动。使用tranparent bg添加GIF图片
1
A
回答
0
尝试使用Bitmap.MakeTransparent
和OnPaint
事件ImageAnimator.UpdateFrames
简单PictureBox
:
private Image animGif;// gif animation file
private void Form1_Load(object sender, EventArgs e)
{
animGif = new Bitmap("file.png");
ImageAnimator.Animate(animGif, Animate);
}
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
ImageAnimator.UpdateFrames();
var img = new Bitmap(animGif, animGif.Width, animGif.Height);
img.MakeTransparent(Color.White);
e.Graphics.Clear(pictureBox1.BackColor);
e.Graphics.DrawImage(img, new Point(0, 0));
}
private void Animate(object sender, EventArgs e)
{
pictureBox1.Invalidate();
}
相关问题
- 1. 用BG颜色在div上添加图片
- 2. 使用图片图标上可以加载一个.gif
- 3. 操纵.gif图片
- 4. 使用gif,jpg,png等上传图片
- 5. gif加载后更改背景图片?
- 6. 从.Res文件加载Gif图片
- 7. 使用imagemagick创建GIF图片 - 转换:图片重叠
- 8. Tranparent屏幕图像Silverlight
- 9. LWUIT:将GIF图像添加到标签
- 10. 添加背景图片使用PhotoChooserTask
- 11. 使用firemonkey添加图片库
- 12. 使用ThreadPool添加倍数图片盒
- 13. 将gif图像添加到chart.js V2.0
- 14. 添加卡片图片C#
- 15. 上传jpg/png/gif图片
- 16. 在图像上方添加gif
- 17. 添加在图片
- 18. 使用Gif图像
- 19. CKEDITOR添加图片
- 20. 如何使用.png图片而不是.gif图片在iphone中使用动画显示图片?
- 21. 在tabBarItem上添加GIF
- 22. 如何添加图片到图片?
- 23. 在图片上添加图片点击
- 24. 使用js将图片从网址添加到图片库html使用js
- 25. jQuery函数添加alpha到元素bg
- 26. 表中添加BG图像孩子的div
- 27. 如何将GIf图像添加为视图上的图层?
- 28. Rails:ActionController :: InvalidAuthenticityToken添加图片时
- 29. 添加图片框在IVideoWindow
- 30. 替换图片源(添加)
你可以从GIF转换你的图片,实际上是支持的格式(PNG也许?) – 2012-08-13 10:06:11
我想我的图片动画! !实际上,这是一个加载的圈子,它的轨道直到加载 – TYeeTY 2012-08-13 10:11:15