Examples of LockBits()


Examples of cli.System.Drawing.Bitmap.LockBits()

            int height = bitmap.get_Height();
            int size = width * height;
            int[] pixelData = new int[size];
           
            cli.System.Drawing.Rectangle rect = new cli.System.Drawing.Rectangle(0, 0, width, height);
            cli.System.Drawing.Imaging.BitmapData data = bitmap.LockBits(rect, ImageLockMode.wrap(ImageLockMode.ReadOnly), PixelFormat.wrap(PixelFormat.Format32bppArgb));
            cli.System.IntPtr pixelPtr = data.get_Scan0();
            cli.System.Runtime.InteropServices.Marshal.Copy(pixelPtr, pixelData, 0, size);       
            bitmap.UnlockBits(data);
           
            //source.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.