, - - , , SetPixel (, ). , , ColorMatrix. DrawImage , R/G/B/A . , :
using ( var bmp = new Bitmap( 100, 100 ) )
using ( var g = Graphics.FromImage( bmp ) )
using ( var ia = new ImageAttributes() )
{
float R = 1;
float G = 0;
float B = 0;
ia.SetColorMatrix( new ColorMatrix( new float[][] {
new float[] {1, 0, 0, R, 0},
new float[] {0, 1, 0, G, 0},
new float[] {0, 0, 1, B, 0},
new float[] {0, 0, 0, 0, 0},
new float[] {0, 0, 0, 0, 1}} ) );
g.Clear( Color.White );
g.FillEllipse( Brushes.Blue, 10, 10, 30, 30 );
g.FillEllipse( Brushes.Red, 60, 10, 30, 30 );
g.FillEllipse( Brushes.Green, 10, 60, 30, 30 );
g.FillEllipse( Brushes.Black, 60, 60, 30, 30 );
e.Graphics.DrawImage(
bmp,
new Rectangle( 0, 0, 100, 100 ),
0, 0, 100, 100,
GraphicsUnit.Pixel,
ia );
}
R/G/B 1 , , . , - , : GDI +.