// Create rectangle for region.
Rectangle excludeRect = new Rectangle(0, 0, 150, 150);
// Create region for exclusion.
Region excludeRegion = new Region(excludeRect);
// Set clipping region to exclude region.
newGraphics.ExcludeClip(excludeRegion);
// Fill large rectangle to show clipping region.
//newGraphics.FillRectangle(new SolidBrush(Color.White), 0, 0, 320, 240);
*/
/////////////////////////////////////////////////////////////////////////////////////
//newImage.RotateFlip(System.Drawing.RotateFlipType.Rotate90FlipX);
// Draw adjusted image to screen.
newGraphics.DrawImage(newImage,destRect2,x, y,width, height,
units,ia,imageCallback,imageCallbackData);
//System.Drawing.Bitmap b = new Bitmap(newImage,150,150);
newImage.Save(MemStream, System.Drawing.Imaging.ImageFormat.Png);//"D:\\sdfsfs.png"
MemStream.WriteTo(Response.OutputStream);//OutputStream
Response.OutputStream.Close();//"D:\\CppPNG.png"
}
}
catch (Exception ex)
{
newGraphics.DrawString(
ex.ToString(),
new Font("Arial", 8),
Brushes.Black,
new PointF(0, 0));
}
}