Created
May 25, 2018 10:21
-
-
Save s0h1s2/5fd28f34bcbec1e0766fe5d3a6bac017 to your computer and use it in GitHub Desktop.
Example Algorithm for changing Color To Blue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//my algorithm | |
int width = image.Width;//need width of image | |
int height = image.Height;//need height of image | |
for (int x = 0; x < width; x++) | |
{ | |
//getting pixel from width and height | |
for (int y = 0; y <height; y++) | |
{ | |
//getting color of image | |
var c = image.GetPixel(x, y); | |
double red = c.R / 10; | |
double green = c.G /5; | |
double blue = c.B *0.5; | |
image.SetPixel(x, y, Color.FromArgb((int)red, (int)green, (int)blue)); | |
} | |
} | |
pictureBox2.Image = image; | |
return image; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment