Bitmap bit;
private void Form1_Load(object sender, EventArgs e)
{
bit = new Bitmap("heart.bmp");
bit.MakeTransparent(Color.Blue);
}
2. 透過OnPaint方法來載入要在表單中顯示的圖片
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.DrawImage((Image)bit, new Point(0,0));
}
沒有留言:
張貼留言