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. using System.Drawing.Drawing2D;
  10. using System.Drawing.Imaging;
  11.  
  12. namespace WindowsFormsApplication1
  13. {
  14. public partial class Form1 : Form
  15. {
  16. public Form1()
  17. {
  18. InitializeComponent();
  19. }
  20.  
  21. private void Form1_Load(object sender, EventArgs e)
  22. {
  23. RectangleF rect = new RectangleF(0.0f, 0.0f, 100.0f, 100.0f);
  24. RectangleF canvas = new RectangleF(0.0f, 0.0f, 150.0f, 150.0f);
  25. GraphicsPath gp = new GraphicsPath();
  26. gp.AddRectangle(rect);
  27.  
  28. Bitmap bmp = new Bitmap((int)canvas.Width, (int)canvas.Height,PixelFormat.Format32bppArgb);
  29.  
  30. using (Graphics g = Graphics.FromImage(bmp))
  31. {
  32. g.FillRectangle(Brushes.White, canvas);
  33. Matrix m = new Matrix();
  34. m.Translate(10, 10);
  35. m.Scale(0.5f, 0.5f);
  36. g.Transform = m;
  37. g.DrawPath(Pens.Blue, gp);
  38. }
  39. pictureBox1.Image = bmp;
  40. }
  41.  
  42. private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
  43. {
  44. this.Text = "X:" + e.X.ToString() +
  45. " Y:" + e.Y.ToString();
  46. }
  47. }
  48. }
  49.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty