我有Visual Studio 2013,我正在編程在C#中。
我有這樣的代碼,但它不工作:(visual c#)不顯示我的圖像
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.Text = "Bitmap loader";
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
surface = new Bitmap(this.Size.Width, this.Size.Height);
pictureBox1.Image = surface;
device = Graphics.FromImage(surface);
image = Properties.Resources.dragon;
pictureBox1.Image = image;
device.DrawImage(Properties.Resources.dragon, 10, 10);
pictureBox1.Image = image;
this.Refresh();
}
我已經把this圖像到resurce。 當我點擊運行,它顯示一個空的窗口。
我怎樣才能實現這個屏幕顯示我的形象? (任何人都可以鏈接我的progect ???)
這是行不通的 – Lorenzo