예제 #1
0
 public void SetPixel(int x, int y, Color color)
 {
     if (x >= 0 && x < Width)
     {
         if (y >= 0 && y < Height)
         {
             Bmp.SetPixel(x, y, color);
         }
     }
 }
예제 #2
0
 public void SetPixel(int x, int y, Color color)
 {
     if (x >= 0 && x < Bmp.Width)
     {
         if (y >= 0 && y < Bmp.Height)
         {
             if (!isLocked)
             {
                 Bmp.SetPixel(x, y, color);
             }
             else
             {
                 unsafe
                 {
                     byte *currentPixel = (byte *)bmpData.Scan0 + (y * bmpData.Stride) + x * 4;
                     currentPixel[0] = color.B;
                     currentPixel[1] = color.G;
                     currentPixel[2] = color.R;
                     currentPixel[3] = color.A;
                 }
             }
         }
     }
 }
예제 #3
0
 public void SetPixel(int x, int y, Color color)
 {
     if (x >= 0 && x < Bmp.Width)
     {
         if (y >= 0 && y < Bmp.Height)
         {
             if (!isLocked)
             {
                 Bmp.SetPixel(x, y, color);
             }
             else
             {
                 unsafe
                 {
                     byte *currentPixel = (byte *)bmpData.Scan0 + (y * bmpData.Stride) + x * 4;
                     byte  B            = currentPixel[0];
                     byte  G            = currentPixel[1];
                     byte  R            = currentPixel[2];
                     byte  A            = currentPixel[3];
                 }
             }
         }
     }
 }