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.
DIB-Pointer from VintasoftImage
Moderator: Alex
Re: DIB-Pointer from VintasoftImage
Hello Daniel,
Yes, please try to use the following code:
--
Sincerely,
Yuri
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
Re: DIB-Pointer from VintasoftImage
Perfect, thank you!