Csharp/CSharp Tutorial/2D/Ico

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Load an ico file

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ruponentModel;
using System.Windows.Forms;
using System.Data;
public class BitmapLoading : System.Windows.Forms.Form
{
  public BitmapLoading()
  {
    this.BackColor = System.Drawing.Color.White;
    this.ClientSize = new System.Drawing.Size(400, 400);
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.BitmapLoading_Paint);
  }
  static void Main() 
  {
    Application.Run(new BitmapLoading());
  }
  private void BitmapLoading_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
  {
    Graphics g = e.Graphics;
    Bitmap b = new Bitmap("1.ico");
    g.DrawImage(b, 10, 10, 350, 300);
  }
}