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)
{
Rectangle rect = new Rectangle(0, 0, 100, 100);
Rectangle canvas = new Rectangle(0, 0, 150, 150);
GraphicsPath gp = new GraphicsPath();
gp.AddRectangle(rect);
Bitmap bmp = new Bitmap(canvas.Width, canvas.Height,PixelFormat.Format32bppArgb);
using (Graphics g = Graphics.FromImage(bmp))
{
g.FillRectangle(Brushes.White, canvas);
Matrix m = new Matrix();
m.Translate(10, 10);
m.Scale(0.5f, 0.5f);
g.Transform = m;
g.DrawPath(Pens.Blue, gp);
}
pictureBox1.Image = bmp;
}
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
this.Text = "X:" + e.X.ToString() +
" Y:" + e.Y.ToString();
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkNvbXBvbmVudE1vZGVsOwp1c2luZyBTeXN0ZW0uRGF0YTsKdXNpbmcgU3lzdGVtLkRyYXdpbmc7CnVzaW5nIFN5c3RlbS5MaW5xOwp1c2luZyBTeXN0ZW0uVGV4dDsKdXNpbmcgU3lzdGVtLldpbmRvd3MuRm9ybXM7CnVzaW5nIFN5c3RlbS5EcmF3aW5nLkRyYXdpbmcyRDsKdXNpbmcgU3lzdGVtLkRyYXdpbmcuSW1hZ2luZzsKCm5hbWVzcGFjZSBXaW5kb3dzRm9ybXNBcHBsaWNhdGlvbjEKewogICAgcHVibGljIHBhcnRpYWwgY2xhc3MgRm9ybTEgOiBGb3JtCiAgICB7CiAgICAgICAgcHVibGljIEZvcm0xKCkKICAgICAgICB7CiAgICAgICAgICAgIEluaXRpYWxpemVDb21wb25lbnQoKT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