매우 기본적인 이미지 편집기를 만들고 색상 (R, G, B) 값을 수치로 설정하려고합니다. 예를 들어, 내 코드 조각은 다음과 같습니다.포럼 응용 프로그램의 픽셀 색상 변경 C#
for (int row = 0; row < thePicture.Width; row = row + 1)
{
for (int col = 0; col < thePicture.Height; col = col + 1)
{
Color pixel = thePicture.GetPixel(row, col);
pixel = Color.FromArgb(5 + pixel.R, 5 + pixel.G, 5 + pixel.B);
//+5 is making the image darker... I think
if (pixel.R > 255)//This is used to prevent the program from crashing
{
pixel.R = //is this possible? or another way? I am intending
} //Make this 255
thePicture.SetPixel(row, col, pixel);
}
}
Windows 포럼에 있다는 것을 기억하십시오. Nothhing 너무 C#의 매우 기본적인 이해하시기 바랍니다. 감사합니다
매우 유용합니다! 감사 – user2970816