Forum > macOS / Mac OS X

Converting system default images to TBitmap


I'm working on a NSToolbar component for Lazarus. As images, it can use a list of system images represented as NSString, which can be read using NSImage.imageNamed( and thus passed to the toolbar item.

Now I'm creating a designtime editor and would like to list the system images not just by name, but also with their image, e.g. in a TComboBoxEx.

I'm failing at converting these images though. Using NSData, I can get a TMemoryStream containing the image data, but I can't load it into a TBitmap.
I've tried these approaches:

* This forum: Convert NSImage to Bitmap
* This forum: TImage and TIFF files
* Using BGRABitmapPack to see if they use a different tiff loader
The file format seems to be an 8 bit uncompressed tiff. Which doesn't sound too spectactular to me.

this is my code in its context


[0] Message Index

Go to full version