[英]How to add animated gif in a pictureBox?
In the project sources i added the animated gif a existing file : On the right bottom i see the type if bitmap and not gif.在项目来源中,我将动画 gif 添加到现有文件中:在右下角,我看到类型是位图而不是 gif。
In the form code :在表单代码中:
using Capture_Screen.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Test
{
public partial class SettingsForm : Form
{
public SettingsForm()
{
InitializeComponent();
pictureBox1.Image = Resources.Settings;
}
private void SettingsForm_Load(object sender, EventArgs e)
{
}
}
}
The result when running the application in the pictureBox i see some brown color instead playing the animated gif :在 pictureBox 中运行应用程序时的结果,我看到一些棕色而不是播放动画 gif:
this works for me这对我有用
private Bitmap gifImage;
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage ;
gifImage = new Bitmap(pathofImage);
pictureBox1.Image = (Image) gifImage;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.