Luxand.FSDK.LoadImageFromCLRImage C# (CSharp) Method

LoadImageFromCLRImage() public static method

public static LoadImageFromCLRImage ( int &Image, System ImageObject ) : int
Image int
ImageObject System
return int
        public static int LoadImageFromCLRImage(ref int Image, System.Drawing.Image ImageObject)
        {
            System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(ImageObject);
            IntPtr hbm = bmp.GetHbitmap();
            int res = LoadImageFromHBitmap(ref Image, hbm);
            DeleteObject(hbm);
            bmp.Dispose();
            return res;
        }

Usage Example

 CImage(System.Drawing.Image ImageObject)
 {
     hImage = -1;
     CheckForError(FSDK.LoadImageFromCLRImage(ref hImage, ImageObject));
     PopulateHeightAndWidth();
 }
FSDK