Bitmap bmp1 = new Bitmap (picori.image); // Create a graphical object Bitmap bmp2 = new Bitmap (picori.image); using (Graphics g = picthumb.creategraphics ()) // create Artboards G.clear (picthumb.backcolor); // empty artboard G.scaletransform (0.5f ,
0.5f
, System.Drawing.Drawing2D.MatrixOrder.Append); // zoom
/* Zoom */
int width = Convert.ToInt32 (0.5*image. Width);//Shrinkage Relaxation
int height = Convert.ToInt32 (0.5 * image). height);//zoom level
Graphics. DrawImage (image, this.) CLIENTSIZE.WIDTH/2, this. CLIENTSIZE.HEIGHT/2, width, Height);//Drawing an image
/* Zoom */
/* Rotate */
G.rotatetransform (320F);//rotation
Image image = Global::test. properties.resources.chatformbg;//image.fromfile ("11.jpg");
//Gets the center point of the current window
Rectangle rec = new Rectangle (0, 0, this. Clientsize.width, this. Clientsize.height);
PointF Center = new PointF (rec. WIDTH/2, rec. HEIGHT/2);
Float OffsetX = 0;
Float OffsetY = 0;
OffsetX = center. X = image. WIDTH/2;
OffsetY = center. Y-image. HEIGHT/2;
RectangleF recf = new RectangleF (OffsetX, OffsetY, image. Width, image. Height);
PointF centerf = new PointF (RECF. X + RECF. WIDTH/2, RECF. Y + RECF. HEIGHT/2);
//Implement rotation
Graphics g = this. CreateGraphics ();
G.clear (this. BackColor);
G.translatetransform (Centerf. X, Centerf. Y);
G.rotatetransform (10F);
G.translatetransform (-centerf. X,-centerf. Y);
//Display image
G.drawimage (image, New PointF (rec. WIDTH/4, rec. HEIGHT/4));
/* Rotate */
G.translatetransform (10F, 10F);//Pan
// Redraw an image // PictureBox This 0 0 , BMP2. Width, BMP2. Height, GraphicsUnit.Pixel); } Bmp1. Dispose (); Bmp2. Dispose ();
Picture zoom/Rotate/pan