Skip to content

Instantly share code, notes, and snippets.

@phrohdoh
Created June 18, 2014 00:28
Show Gist options
  • Save phrohdoh/d3b0fd5f803e3275b8ec to your computer and use it in GitHub Desktop.
Save phrohdoh/d3b0fd5f803e3275b8ec to your computer and use it in GitHub Desktop.
var image = new Bitmap(100, 100, PixelFormat.Format24bppRgb);
using (var locked = image.Lock()) unsafe
{
for (var x = 0; x < image.Width; x++)
for (var y = 0; y < image.Height; y++)
if (y == image.Height / 3)
image.SetPixel(x, y, Color.FromArgb(70, 0, 0));
}
using (var graphics = new Graphics(image))
{
graphics.DrawImage(image, 100, 100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment