public Bitmap GetBitmapFromHBitmap(IntPtr nativeHBitmap)
{
Bitmap bmp = Bitmap.FromHbitmap(nativeHBitmap);
if (Bitmap.GetPixelFormatSize(bmp.PixelFormat) < 32) return bmp;
BitmapData bmpData;
if (IsAlphaBitmap(bmp, out bmpData))
{
Bitmap resBmp = GetlAlphaBitmapFromBitmapData(bmpData);
bmpData = null;
return resBmp;
}
bmpData = null;
return bmp;
}
#endregion