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 » Thu Oct 08, 2015 5:55 pm

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: 56
Joined: Wed Jul 23, 2008 2:47 pm

Re: DIB-Pointer from VintasoftImage

Post by Yuri » Fri Oct 09, 2015 10:28 am

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 » Fri Oct 09, 2015 10:45 am

Perfect, thank you!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests