示例#1
0
 public Color GetPixel(int x, int y)
 {
     if (x >= 0 && x < Bmp.Width)
     {
         if (y >= 0 && y < Bmp.Height)
         {
             if (!isLocked)
             {
                 return(Bmp.GetPixel(x, y));
             }
             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];
                     return(Color.FromArgb(A, R, G, B));
                 }
             }
         }
     }
     return(Color.Transparent);
 }
示例#2
0
 public void EyeDropper()   //Left Click Color
 {
     if (Bmp.GetPixel(CurrentX, CurrentY) != Color.FromArgb(0, 0, 0, 0))
     {
         Mod.GetColorPickerUIElement().Color = Bmp.GetPixel(CurrentX, CurrentY);
     }
 }
示例#3
0
 public Color GetPixel(int x, int y)
 {
     if (x >= 0 && x < Width)
     {
         if (y >= 0 && y < Height)
         {
             return(Bmp.GetPixel(x, y));
         }
     }
     return(Color.White);
 }