<PackageReference Include="System.Drawing.Common" Version="10.0.0-preview.7.25380.108" />

IPicture

using System; using System.CodeDom.Compiler; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using Windows.Win32.Foundation; using Windows.Win32.Graphics.Gdi; using Windows.Win32.System.Com; namespace Windows.Win32.System.Ole { [Guid("7BF80980-BF32-101A-8BBB-00AA00300CAB")] [SupportedOSPlatform("windows5.0")] [GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")] internal struct IPicture : IVTable<IPicture, IPicture.Vtbl>, IVTable, IComIID { internal struct Vtbl { internal IntPtr QueryInterface_1; internal IntPtr AddRef_2; internal IntPtr Release_3; internal IntPtr get_Handle_4; internal IntPtr get_hPal_5; internal IntPtr get_Type_6; internal IntPtr get_Width_7; internal IntPtr get_Height_8; internal IntPtr Render_9; internal IntPtr set_hPal_10; internal IntPtr get_CurDC_11; internal IntPtr SelectPicture_12; internal IntPtr get_KeepOriginalFormat_13; internal IntPtr put_KeepOriginalFormat_14; internal IntPtr PictureChanged_15; internal IntPtr SaveAsFile_16; internal IntPtr get_Attributes_17; } [ComImport] [Guid("7BF80980-BF32-101A-8BBB-00AA00300CAB")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [SupportedOSPlatform("windows5.0")] internal interface Interface { [PreserveSig] unsafe HRESULT get_Handle(OLE_HANDLE* pHandle); [PreserveSig] unsafe HRESULT get_hPal(OLE_HANDLE* phPal); [PreserveSig] unsafe HRESULT get_Type(PICTYPE* pType); [PreserveSig] unsafe HRESULT get_Width(int* pWidth); [PreserveSig] unsafe HRESULT get_Height(int* pHeight); [PreserveSig] unsafe HRESULT Render(HDC hDC, int x, int y, int cx, int cy, int xSrc, int ySrc, int cxSrc, int cySrc, RECT* pRcWBounds); [PreserveSig] HRESULT set_hPal(OLE_HANDLE hPal); [PreserveSig] unsafe HRESULT get_CurDC(HDC* phDC); [PreserveSig] unsafe HRESULT SelectPicture(HDC hDCIn, HDC* phDCOut, OLE_HANDLE* phBmpOut); [PreserveSig] unsafe HRESULT get_KeepOriginalFormat(BOOL* pKeep); [PreserveSig] HRESULT put_KeepOriginalFormat(BOOL keep); [PreserveSig] HRESULT PictureChanged(); [PreserveSig] unsafe HRESULT SaveAsFile(IStream* pStream, BOOL fSaveMemCopy, int* pCbSize); [PreserveSig] unsafe HRESULT get_Attributes(uint* pDwAttr); } private unsafe void** lpVtbl; internal static readonly Guid IID_Guid = new Guid(2079852928, 48946, 4122, 139, 187, 0, 170, 0, 48, 12, 171); [IsReadOnly] static unsafe ref Guid IComIID.Guid { [MethodImpl(MethodImplOptions.AggressiveInlining)] [return: IsReadOnly] get { return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(new ReadOnlySpan<byte>(&global::<PrivateImplementationDetails>.5DD3F6391C2367844290C86255C17C2E2F7B1013DEE882965196A7054198DACB, 16))); } } internal unsafe HRESULT QueryInterface([In] [IsReadOnly] ref Guid riid, out void* ppvObject) { fixed (void** ppvObject2 = &ppvObject) { fixed (Guid* riid2 = &riid) { return QueryInterface(riid2, ppvObject2); } } } public unsafe HRESULT QueryInterface(Guid* riid, void** ppvObject) { IntPtr intPtr = (IntPtr)(*lpVtbl); return (HRESULT); } public unsafe uint AddRef() { IntPtr intPtr = (IntPtr)lpVtbl[1]; return (uint); } public unsafe uint Release() { IntPtr intPtr = (IntPtr)lpVtbl[2]; return (uint); } internal unsafe HRESULT get_Handle(out OLE_HANDLE pHandle) { fixed (OLE_HANDLE* pHandle2 = &pHandle) { return get_Handle(pHandle2); } } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT get_Handle(IPicture* pThis, OLE_HANDLE* pHandle) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.get_Handle(pHandle); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT get_Handle(OLE_HANDLE* pHandle) { IntPtr intPtr = (IntPtr)lpVtbl[3]; return (HRESULT); } internal unsafe HRESULT get_hPal(out OLE_HANDLE phPal) { fixed (OLE_HANDLE* phPal2 = &phPal) { return get_hPal(phPal2); } } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT get_hPal(IPicture* pThis, OLE_HANDLE* phPal) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.get_hPal(phPal); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT get_hPal(OLE_HANDLE* phPal) { IntPtr intPtr = (IntPtr)lpVtbl[4]; return (HRESULT); } internal unsafe HRESULT get_Type(out PICTYPE pType) { fixed (PICTYPE* pType2 = &pType) { return get_Type(pType2); } } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT get_Type(IPicture* pThis, PICTYPE* pType) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.get_Type(pType); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT get_Type(PICTYPE* pType) { IntPtr intPtr = (IntPtr)lpVtbl[5]; return (HRESULT); } internal unsafe HRESULT get_Width(out int pWidth) { fixed (int* pWidth2 = &pWidth) { return get_Width(pWidth2); } } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT get_Width(IPicture* pThis, int* pWidth) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.get_Width(pWidth); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT get_Width(int* pWidth) { IntPtr intPtr = (IntPtr)lpVtbl[6]; return (HRESULT); } internal unsafe HRESULT get_Height(out int pHeight) { fixed (int* pHeight2 = &pHeight) { return get_Height(pHeight2); } } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT get_Height(IPicture* pThis, int* pHeight) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.get_Height(pHeight); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT get_Height(int* pHeight) { IntPtr intPtr = (IntPtr)lpVtbl[7]; return (HRESULT); } internal unsafe HRESULT Render(HDC hDC, int x, int y, int cx, int cy, int xSrc, int ySrc, int cxSrc, int cySrc, [In] [IsReadOnly] ref RECT pRcWBounds) { fixed (RECT* pRcWBounds2 = &pRcWBounds) { return Render(hDC, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, pRcWBounds2); } } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT Render(IPicture* pThis, HDC hDC, int x, int y, int cx, int cy, int xSrc, int ySrc, int cxSrc, int cySrc, RECT* pRcWBounds) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.Render(hDC, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, pRcWBounds); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT Render(HDC hDC, int x, int y, int cx, int cy, int xSrc, int ySrc, int cxSrc, int cySrc, RECT* pRcWBounds) { IntPtr intPtr = (IntPtr)lpVtbl[8]; return (HRESULT); } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT set_hPal(IPicture* pThis, OLE_HANDLE hPal) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.set_hPal(hPal); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT set_hPal(OLE_HANDLE hPal) { IntPtr intPtr = (IntPtr)lpVtbl[9]; return (HRESULT); } internal unsafe HRESULT get_CurDC(out HDC phDC) { fixed (HDC* phDC2 = &phDC) { return get_CurDC(phDC2); } } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT get_CurDC(IPicture* pThis, HDC* phDC) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.get_CurDC(phDC); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT get_CurDC(HDC* phDC) { IntPtr intPtr = (IntPtr)lpVtbl[10]; return (HRESULT); } internal unsafe HRESULT SelectPicture(HDC hDCIn, out HDC phDCOut, out OLE_HANDLE phBmpOut) { fixed (OLE_HANDLE* phBmpOut2 = &phBmpOut) { fixed (HDC* phDCOut2 = &phDCOut) { return SelectPicture(hDCIn, phDCOut2, phBmpOut2); } } } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT SelectPicture(IPicture* pThis, HDC hDCIn, HDC* phDCOut, OLE_HANDLE* phBmpOut) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.SelectPicture(hDCIn, phDCOut, phBmpOut); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT SelectPicture(HDC hDCIn, HDC* phDCOut, OLE_HANDLE* phBmpOut) { IntPtr intPtr = (IntPtr)lpVtbl[11]; return (HRESULT); } internal unsafe HRESULT get_KeepOriginalFormat(out BOOL pKeep) { fixed (BOOL* pKeep2 = &pKeep) { return get_KeepOriginalFormat(pKeep2); } } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT get_KeepOriginalFormat(IPicture* pThis, BOOL* pKeep) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.get_KeepOriginalFormat(pKeep); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT get_KeepOriginalFormat(BOOL* pKeep) { IntPtr intPtr = (IntPtr)lpVtbl[12]; return (HRESULT); } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT put_KeepOriginalFormat(IPicture* pThis, BOOL keep) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.put_KeepOriginalFormat(keep); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT put_KeepOriginalFormat(BOOL keep) { IntPtr intPtr = (IntPtr)lpVtbl[13]; return (HRESULT); } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT PictureChanged(IPicture* pThis) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.PictureChanged(); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT PictureChanged() { IntPtr intPtr = (IntPtr)lpVtbl[14]; return (HRESULT); } internal unsafe HRESULT SaveAsFile(IStream* pStream, BOOL fSaveMemCopy, out int pCbSize) { fixed (int* pCbSize2 = &pCbSize) { return SaveAsFile(pStream, fSaveMemCopy, pCbSize2); } } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT SaveAsFile(IPicture* pThis, IStream* pStream, BOOL fSaveMemCopy, int* pCbSize) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.SaveAsFile(pStream, fSaveMemCopy, pCbSize); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT SaveAsFile(IStream* pStream, BOOL fSaveMemCopy, int* pCbSize) { IntPtr intPtr = (IntPtr)lpVtbl[15]; return (HRESULT); } internal unsafe HRESULT get_Attributes(out uint pDwAttr) { fixed (uint* pDwAttr2 = &pDwAttr) { return get_Attributes(pDwAttr2); } } [UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvStdcall) })] private unsafe static HRESULT get_Attributes(IPicture* pThis, uint* pDwAttr) { try { Interface object; HRESULT result = ComHelpers.UnwrapCCW<IPicture, Interface>(pThis, out object); if (!result.Failed) return object.get_Attributes(pDwAttr); return result; } catch (Exception ex) { return (HRESULT)ex.HResult; } } public unsafe HRESULT get_Attributes(uint* pDwAttr) { IntPtr intPtr = (IntPtr)lpVtbl[16]; return (HRESULT); } internal unsafe HRESULT QueryInterface<[IsUnmanaged] T>(out T* ppv) where T : struct { Guid riid = typeof(T).GUID; void* ppvObject; HRESULT result = QueryInterface(ref riid, out ppvObject); if (result.Succeeded) ppv = (T*)ppvObject; else ppv = null; return result; } public unsafe static void PopulateVTable(Vtbl* vtable) { vtable->get_Handle_4 = (IntPtr)(void*); vtable->get_hPal_5 = (IntPtr)(void*); vtable->get_Type_6 = (IntPtr)(void*); vtable->get_Width_7 = (IntPtr)(void*); vtable->get_Height_8 = (IntPtr)(void*); vtable->Render_9 = (IntPtr)(void*); vtable->set_hPal_10 = (IntPtr)(void*); vtable->get_CurDC_11 = (IntPtr)(void*); vtable->SelectPicture_12 = (IntPtr)(void*); vtable->get_KeepOriginalFormat_13 = (IntPtr)(void*); vtable->put_KeepOriginalFormat_14 = (IntPtr)(void*); vtable->PictureChanged_15 = (IntPtr)(void*); vtable->SaveAsFile_16 = (IntPtr)(void*); vtable->get_Attributes_17 = (IntPtr)(void*); } unsafe void IVTable<IPicture, Vtbl>.PopulateVTable(Vtbl* vtable) { this.PopulateVTable(vtable); } } }