/// <summary> /// BitmapEx object into system memory. /// </summary> /// <param name="rect">A System.Drawing.Rectangle structure specifying the portion of the BitmapEx to lock. </param> /// <param name="flags">Access level (read and write) for the BitmapEx object. ></param> /// <param name="format">PixelFormat enumeration specifying the data format of this BitmapEx object.</param> /// <returns>BitmapData object containing information about this lock operation. </returns> public OpenNETCF.Drawing.Imaging.BitmapData LockBits(Rectangle rect, int flags, PixelFormat format) { //TODO: Don't care about PixelFormat. For now they are all converted to 24 bits OpenNETCF.Drawing.Imaging.BitmapData data; data = new OpenNETCF.Drawing.Imaging.BitmapData(); saveHBitmap = hBitmap; hBitmap = GDIPlus.BitmapLockBits(this, 0, 0, data); GC.KeepAlive(this); return(data); }
/// <summary> /// Unlocks this BitmapEx from system memory. /// </summary> /// <param name="data"></param> public void UnlockBits(OpenNETCF.Drawing.Imaging.BitmapData data) { GDIPlus.DeleteObject(saveHBitmap); //hBitmap = saveHBitmap; }