VintaSoft Imaging .NET SDK and Plug-ins Discussions

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Board index < VintaSoft Imaging < VintaSoft Imaging .NET SDK and Plug-ins Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

DIB-Pointer from VintasoftImage



DIB-Pointer from VintasoftImage

Post by DanielLW »

Hello,

i have an external process which takes an Int-Pointer to a Windows Device Independent Bitmap (DIB) as a parameter.

Is it possible to get the DIB from a VintasoftImage and the int-pointer to it? I've found the DibFile and DibPage classes, but it seems there are no properties or methods to get the int pointer.

Can this somehow be accomplished?

Thank you.


Re: DIB-Pointer from VintasoftImage

Post by Yuri »

Hello Daniel,

Yes, please try to use the following code:
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
public static extern bool DeleteObject(IntPtr hObject);


VintasoftImage image = ...;
// create bitmap form VintasoftImage
using (Bitmap bitmap = image.GetAsBitmap())
{
    // create a GDI bitmap object from bitmap
    IntPtr hBitmap = bitmap.GetHbitmap();

    // ...
    // do something with hBitmap
    // ...
    
    // delete GDI object and free memory
    DeleteObject(hBitmap);
}
--
Sincerely,
Yuri


Re: DIB-Pointer from VintasoftImage

Post by DanielLW »

Perfect, thank you!


Page 1 from 1: 1