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)
{
RectangleF rect = new RectangleF(0.0f, 0.0f, 100.0f, 100.0f);
RectangleF canvas = new RectangleF(0.0f, 0.0f, 150.0f, 150.0f);
GraphicsPath gp = new GraphicsPath();
gp.AddRectangle(rect);
Bitmap bmp = new Bitmap((int)canvas.Width, (int)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();
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkNvbXBvbmVudE1vZGVsOwp1c2luZyBTeXN0ZW0uRGF0YTsKdXNpbmcgU3lzdGVtLkRyYXdpbmc7CnVzaW5nIFN5c3RlbS5MaW5xOwp1c2luZyBTeXN0ZW0uVGV4dDsKdXNpbmcgU3lzdGVtLldpbmRvd3MuRm9ybXM7CnVzaW5nIFN5c3RlbS5EcmF3aW5nLkRyYXdpbmcyRDsKdXNpbmcgU3lzdGVtLkRyYXdpbmcuSW1hZ2luZzsKCm5hbWVzcGFjZSBXaW5kb3dzRm9ybXNBcHBsaWNhdGlvbjEKewogICAgcHVibGljIHBhcnRpYWwgY2xhc3MgRm9ybTEgOiBGb3JtCiAgICB7CiAgICAgICAgcHVibGljIEZvcm0xKCkKICAgICAgICB7CiAgICAgICAgICAgIEluaXRpYWxpemVDb21wb25lbnQoKTsKICAgICAgICB9CgogICAgICAgIHByaXZhdGUgdm9pZCBGb3JtMV9Mb2FkKG9iamVjdCBzZW5kZXIsIEV2ZW50QXJncyBlKQogICAgICAgIHsKICAgICAgICAgICAgUmVjdGFuZ2xlRiByZWN0ID0gbmV3IFJlY3RhbmdsZUYoMC4wZiwgMC4wZiwgMTAwLjBmLCAxMDAuMGYpOwogICAgICAgICAgICBSZWN0YW5nbGVGIGNhbnZhcyA9IG5ldyBSZWN0YW5nbGVGKDAuMGYsIDAuMGYsIDE1MC4wZiwgMTUwLjBmKTsKICAgICAgICAgICAgR3JhcGhpY3NQYXRoIGdwID0gbmV3IEdyYXBoaWNzUGF0aCgpOwogICAgICAgICAgICBncC5BZGRSZWN0YW5nbGUocmVjdCk7CgogICAgICAgICAgICBCaXRtYXAgYm1wID0gbmV3IEJpdG1hcCgoaW50KWNhbnZhcy5XaWR0aCwgKGludCljYW52YXMuSGVpZ2h0LFBpeGVsRm9ybWF0LkZvcm1hdDMyYnBwQXJnYik7CgogICAgICAgICAgICB1c2luZyAoR3JhcGhpY3MgZyA9IEdyYXBoaWNzLkZyb21JbWFnZShibXApKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBnLkZpbGxSZWN0YW5nbGUoQnJ1c2hlcy5XaGl0ZSwgY2FudmFzKTsKICAgICAgICAgICAgICAgIE1hdHJpeCBtID0gbmV3IE1hdHJpeCgpOwogICAgICAgICAgICAgICAgbS5UcmFuc2xhdGUoMTAsIDEwKTsKICAgICAgICAgICAgICAgIG0uU2NhbGUoMC41ZiwgMC41Zik7CiAgICAgICAgICAgICAgICBnLlRyYW5zZm9ybSA9IG07CiAgICAgICAgICAgICAgICBnLkRyYXdQYXRoKFBlbnMuQmx1ZSwgZ3ApOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHBpY3R1cmVCb3gxLkltYWdlID0gYm1wOwogICAgICAgIH0KCiAgICAgICAgcHJpdmF0ZSB2b2lkIHBpY3R1cmVCb3gxX01vdXNlTW92ZShvYmplY3Qgc2VuZGVyLCBNb3VzZUV2ZW50QXJncyBlKQogICAgICAgIHsKICAgICAgICAgICAgdGhpcy5UZXh0ID0gIlg6IiArIGUuWC5Ub1N0cmluZygpICsKICAgICAgICAgICAgICAgICIgWToiICsgZS5ZLlRvU3RyaW5nKCk7CiAgICAgICAgfQogICAgfQp9Cg==