Recent

Author Topic: Converting system default images to TBitmap  (Read 369 times)

CCRDude

  • Hero Member
  • *****
  • Posts: 602
Converting system default images to TBitmap
« on: February 09, 2024, 02:36:55 pm »
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(...name...) 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:

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

 

TinyPortal © 2005-2018