Platforms to show: All Mac Windows Linux Cross-Platform

Back to WindowsBitmapMBS module.

WindowsBitmapMBS.BitmapToDIB(HBitmap as Ptr, HPalette as Ptr = nil) as Ptr

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Picture Plugin 15.1 ❌ No ✅ Yes ❌ No ❌ No All
Converts a HBitmap to a HDIB.

HPalette is optional a color palette handle for images with 8 bit or less per pixel.

WindowsBitmapMBS.DeleteBitmap(HBitmap as Ptr)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Picture Plugin 15.1 ❌ No ✅ Yes ❌ No ❌ No All
Frees a HDIB or HBITMAP.

You need to free the images you allocate to make sure memory is released.

WindowsBitmapMBS.DIBToBitmap(HDIB as Ptr, HPalette as Ptr = nil) as Ptr

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Picture Plugin 15.1 ❌ No ✅ Yes ❌ No ❌ No All
Converts a HDIB to HBitmap.

HPalette is optional a color palette handle for images with 8 bit or less per pixel.
Returns nil in case of no memory.

WindowsBitmapMBS.DuplicateHBitmap(HBitmap as Ptr, Width as Integer, Height as Integer) as Ptr

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Picture Plugin 15.1 ❌ No ✅ Yes ❌ No ❌ No All
Duplicates a bitmap handle.

Please use DeleteBitmap later to free bitmap.

WindowsBitmapMBS.HBitmapInfo(HBitmap as Ptr, byref Width as Integer, byref Height as Integer, byref WidthBytes as Integer, byref Planes as Integer, byref BitsPixel as Integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Picture Plugin 15.1 ❌ No ✅ Yes ❌ No ❌ No All
Queries details about a bitmap handle.

Returns true on success.

WindowsBitmapMBS.HBitmapToPicture(HBitmap as Ptr, UsingDraw as boolean = false) as Picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Picture Plugin 15.1 ❌ No ✅ Yes ❌ No ❌ No All
Converts a HBITMAP to Xojo picture.

If UsingDraw is true, the plugin creates a new HBitmap and draws picture inside.
Else if UsingDraw is false, the plugin copies picture and mask into a new picture.

UsingDraw with false works only for 24 or 32 bit images with one plane.

See also:

WindowsBitmapMBS.HBitmapToPicture(HBitmap as Ptr, Width as Integer, Height as Integer) as Picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Picture Plugin 15.1 ❌ No ✅ Yes ❌ No ❌ No All
Converts a HBITMAP to Xojo picture.

Draws the HBitmap in a new picture of the given size.
This method can be used to resize the bitmap on the fly while drawing.

See also:

WindowsBitmapMBS.PictureToHBitmap(Pic as Picture) as Ptr

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Picture Plugin 15.1 ❌ No ✅ Yes ❌ No ❌ No All
Queries HBitmap of a picture.

As Xojo picture's are internally HBitmaps, the plugin returns the handle of the picture.
No copy is made and you should not free the image. If you need a copy, please use DuplicateHBitmap function.

Please use DeleteBitmap later to free bitmap.

The items on this page are in the following plugins: MBS Picture Plugin.


The biggest plugin in space...