private void Create(Bitmap bmp) { Create(); //******************************************** newBmp = new Bitmap(bmp);//used to create a 32bppPArgb bitmap = new LockBitmap(newBmp); LockBitmap.LockBits(); Marshal.Copy(LockBitmap.Pixels, 0, ptr_Address, LockBitmap.Pixels.Length); LockBitmap.UnlockBits(); }
private void Create(Bitmap bmp) { Create(); //******************************************** newBmp = new Bitmap(bmp);//used to create a 32bppPArgb bitmap = new LockBitmap(newBmp); bitmap.LockBits(); Marshal.Copy(bitmap.Pixels, 0, ptr_Address, bitmap.Pixels.Length); bitmap.UnlockBits(); newBmp.Dispose(); bitmap.Pixels = new byte[0]; bitmap = null; }