About the author
While working on the TTrayIcon component, I learnt how to convert NSImage to TBitmap, and vice versa.
In addition, I've also learnt how to
I've created a few class functions as a result, appropriately named as follows:
ConvertTBitmapToNSImage converts a Windows TBitmap to a Mac OS Cocoa NSImage. ConvertNSImageToTBitmap does the reverse.
Apparently, Mac OS's NSImage supported a few image types, including PNG, TIFF and BMP.
So, how does TTrayIcon behave?
When there's no icon assigned, it retrieves the application icon using ApplicationIcon, and then set it as the TrayIcon image. Currently, the TTrayIcon component supports the OnClick and onDblClick events. It also supports the Title property, which is new.
The FireMonkey TTrayIcon component is superior to the VCL TTrayIcon component as Mac OS supports both an icon and text beside the icon. However, on Windows, this requires the text to be drawn as an image.
More to come...