DIB-Pointer from VintasoftImage

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

Moderator: Alex

Post Reply
DanielLW
Posts: 22
Joined: Tue Sep 01, 2015 2:42 pm

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.
Yuri
Posts: 64
Joined: Wed Jul 23, 2008 2:47 pm

Re: DIB-Pointer from VintasoftImage

Post by Yuri »

Hello Daniel,

Yes, please try to use the following code:

Code: Select all

[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
DanielLW
Posts: 22
Joined: Tue Sep 01, 2015 2:42 pm

Re: DIB-Pointer from VintasoftImage

Post by DanielLW »

Perfect, thank you!
Post Reply