using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; using System.Drawing.Imaging; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { const int w = 640; const int h = 480; Bitmap bmp1 = new Bitmap(w, h, PixelFormat.Format32bppArgb); using (Graphics g = Graphics.FromImage(bmp1)) { g.SmoothingMode = SmoothingMode.AntiAlias; g.FillRectangle(Brushes.Transparent, 0, 0, w, h); g.FillEllipse(Brushes.Blue, 0, 0, w, h); } Bitmap bmp2 = new Bitmap(w, h, PixelFormat.Format32bppArgb); using (Graphics g = Graphics.FromImage(bmp2)) { g.SmoothingMode = SmoothingMode.AntiAlias; g.FillRectangle(Brushes.Gray, 0, 0, w, h); Matrix m = new Matrix(); m.Scale(0.5f, 0.5f); g.Transform = m; g.DrawImage(bmp1,0,0); m.Reset(); g.Transform = m; } PictureBox p = new PictureBox(); p.Dock = DockStyle.Fill; this.Controls.Add(p); this.ClientSize = new Size(w, h); p.Image = bmp2; } } }