private static IPictureDisp GetIPictureDispFromBitmapHandle(IntPtr hBitmapHandle) { object objPicture = null; Guid objGuid = new Guid("00020400-0000-0000-C000-000000000046"); int iResult; PICTDESC tPICTDESC = new PICTDESC(hBitmapHandle); iResult = OleCreatePictureIndirect(ref tPICTDESC, ref objGuid, 1, ref objPicture); return((stdole.IPictureDisp)objPicture); }
private static extern int OleCreatePictureIndirect(ref PICTDESC pPictDesc, ref Guid riid, int fOwn, [MarshalAs(UnmanagedType.IDispatch)] ref object ppvObj);
private static IPictureDisp GetIPictureDispFromBitmapHandle(IntPtr hBitmapHandle) { object objPicture = null; Guid objGuid = new Guid("00020400-0000-0000-C000-000000000046"); int iResult; PICTDESC tPICTDESC = new PICTDESC(hBitmapHandle); iResult = OleCreatePictureIndirect(ref tPICTDESC, ref objGuid, 1, ref objPicture); return (stdole.IPictureDisp)objPicture; }