public static IntPtr ConvertImageToIntPtr(LVBKIMAGE img) { IntPtr ptr = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(LVBKIMAGE))); Marshal.StructureToPtr <LVBKIMAGE>(img, ptr, false); return(ptr); }
public static LVBKIMAGE ConvertIntPtrToImage(IntPtr ptr) { LVBKIMAGE structure = (LVBKIMAGE)Marshal.PtrToStructure(ptr, typeof(LVBKIMAGE)); Console.Out.WriteLine((object)structure.path); return(structure); }
public static Bitmap BitmapFromImage(LVBKIMAGE img) { return(Image.FromHbitmap(img.hbm)); }