: stream>gdi+-bitmap ( stream -- bitmap )\r
stream>IStream &com-release\r
{ void* } [ GdipCreateBitmapFromStream check-gdi+-status ]\r
- [ ] with-out-parameters &GdipFree ;\r
+ with-out-parameters &GdipFree ;\r
\r
: gdi+-bitmap-width ( bitmap -- w )\r
{ UINT } [ GdipGetImageWidth check-gdi+-status ]\r
- [ ] with-out-parameters ;\r
+ with-out-parameters ;\r
: gdi+-bitmap-height ( bitmap -- w )\r
{ UINT } [ GdipGetImageHeight check-gdi+-status ]\r
- [ ] with-out-parameters ;\r
+ with-out-parameters ;\r
: gdi+-lock-bitmap ( bitmap rect mode format -- data )\r
{ BitmapData } [ GdipBitmapLockBits check-gdi+-status ]\r
- [ clone ] with-out-parameters ;\r
+ with-out-parameters ;\r
\r
:: gdi+-bitmap>data ( bitmap -- w h pixels )\r
bitmap [ gdi+-bitmap-width ] [ gdi+-bitmap-height ] bi :> ( w h )\r
: (start-gdi+) ( startup-input -- token startup-output )
{ ULONG_PTR GdiplusStartupOutput }
- [ swapd GdiplusStartup check-gdi+-status ] [ ] with-out-parameters ;
+ [ swapd GdiplusStartup check-gdi+-status ] with-out-parameters ;
: start-gdi+ ( -- token )
standard-gdi+-startup-input (start-gdi+) drop ; inline
: stop-gdi+ ( token -- )
S_OK\r
] with-hresult ;\r
\r
-:: IStream-clone ( out-clone-stream -- hresult )\r
+:: IStream-clone ( stream out-clone-stream -- hresult )\r
f out-clone-stream 0 void* set-alien-value\r
STG_E_INVALIDFUNCTION ;\r
\r