Skip to content

Instantly share code, notes, and snippets.

@felipebaltazar
Created July 3, 2018 19:59
Show Gist options
  • Save felipebaltazar/077a90c3403af443058ff835eb68177f to your computer and use it in GitHub Desktop.
Save felipebaltazar/077a90c3403af443058ff835eb68177f to your computer and use it in GitHub Desktop.
using (var newImage = new Bitmap(width:wid, height:hei))
{
using(Graphics g = Graphics.FromImage(newImage))
{
var imageWidth = this.RayTracerView?.Size.Width ?? 64;
var imageHeight = this.RayTracerView?.Size.Height ?? 64;
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
g.CopyFromScreen(new Point(X, Y),Point.Empty, new Size(wid, hei));
AdjustContrast(newImage,20);
slide = new Bitmap(newImage, new Size(imageWidth, imageHeight));
slide.SetResolution(600,600);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment