winmaped2.pr2.BufferImage.BufferImage C# (CSharp) Method

BufferImage() public method

public BufferImage ( Bitmap bmp ) : System
bmp System.Drawing.Bitmap
return System
        public BufferImage(Bitmap bmp)
            : this(bmp.Width, bmp.Height)
        {
            int w = bmp.Width;
            int h = bmp.Height;

            BitmapData bmpd = bmp.LockBits(new Rectangle(0, 0, w, h), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);

            int dp = pitch;
            int sp = bmpd.Stride / 4;

            int* srcdata = (int*)bmpd.Scan0.ToPointer();
            int* destdata = (int*)Buffer;

            for (int y = 0; y < h; y++) {
                for (int x = 0; x < w; x++) {
                    destdata[y * dp + x] = srcdata[y * sp + x];
                }
            }
            bmp.UnlockBits(bmpd);
        }

Same methods

BufferImage::BufferImage ( int width, int height ) : System
BufferImage::BufferImage ( int width, int height, int pixels ) : System