コード例 #1
0
 public PspBitmap(GuPixelFormats pixelFormat, int width, int height, byte *address, int bytesPerLine = -1)
 {
     GuPixelFormat = pixelFormat;
     Width         = width;
     Height        = height;
     Address       = address;
     BitsPerPixel  = PixelFormatDecoder.GetPixelsBits(pixelFormat);
     ColorFormat   = PixelFormatDecoder.ColorFormatFromPixelFormat(pixelFormat);
     if (bytesPerLine < 0)
     {
         BytesPerLine = PixelFormatDecoder.GetPixelsSize(GuPixelFormat, width);
     }
     else
     {
         BytesPerLine = bytesPerLine;
     }
 }
コード例 #2
0
 private int GetOffset(int x, int y)
 {
     return(y * BytesPerLine + PixelFormatDecoder.GetPixelsSize(GuPixelFormat, x));
 }