fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. using System.Drawing.Drawing2D;
  11. using System.Drawing.Imaging;
  12.  
  13. namespace WindowsFormsApplication1
  14. {
  15. public partial class Form1 : Form
  16. {
  17. public Form1()
  18. {
  19. InitializeComponent();
  20. }
  21.  
  22. private void Form1_Load(object sender, EventArgs e)
  23. {
  24. const int w = 640;
  25. const int h = 480;
  26. Bitmap bmp1 = new Bitmap(w, h, PixelFormat.Format32bppArgb);
  27. using (Graphics g = Graphics.FromImage(bmp1))
  28. {
  29. g.SmoothingMode = SmoothingMode.AntiAlias;
  30. g.FillRectangle(Brushes.Transparent, 0, 0, w, h);
  31. g.FillEllipse(Brushes.Blue, 0, 0, w, h);
  32. }
  33. Bitmap bmp2 = new Bitmap(w, h, PixelFormat.Format32bppArgb);
  34. using (Graphics g = Graphics.FromImage(bmp2))
  35. {
  36. g.SmoothingMode = SmoothingMode.AntiAlias;
  37. g.FillRectangle(Brushes.Gray, 0, 0, w, h);
  38.  
  39. Matrix m = new Matrix();
  40. m.Scale(0.5f, 0.5f);
  41. g.Transform = m;
  42.  
  43. g.DrawImage(bmp1,0,0);
  44.  
  45. m.Reset();
  46. g.Transform = m;
  47. }
  48. PictureBox p = new PictureBox();
  49. p.Dock = DockStyle.Fill;
  50. this.Controls.Add(p);
  51. this.ClientSize = new Size(w, h);
  52. p.Image = bmp2;
  53. }
  54. }
  55. }
  56.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty