May be you can try the other set icon
stuff also.Code: Select all
declare sub Fl_WindowIcon (byval win as Fl_Window ptr, byval icon as const Fl_RGB_Image ptr)
declare sub Fl_WindowIcons (byval win as Fl_Window ptr, byval icons as const Fl_RGB_Image ptr ptr, byval count as long)
declare sub Fl_WindowDefaultIcons (byval win as Fl_Window ptr, byval icons as const Fl_RGB_Image ptr ptr, byval count as long)
But the functionality on Linux depends of the desktop manager you are using.
For example the KDE desktop (in scope of icons) has more or other features like the a GNOME desktop or a XFCE or a LDX etc.
Do you got your Fl_Pixmap image as FL_RGB_Image ?
Code: Select all
' class Fl_Pixmap extends Fl_Image
Fl_Extends(Fl_Pixmap,Fl_Image)
Fl_Extends(Fl_XPM_Image,Fl_Pixmap)
Fl_Extends(Fl_GIF_Image,Fl_Pixmap)
' class Fl_RGB_Image extends Fl_Image
Fl_Extends(Fl_RGB_Image,Fl_Image)
Fl_Extends(Fl_BMP_Image,Fl_RGB_Image)
Fl_Extends(Fl_PNG_Image,Fl_RGB_Image)
Fl_Extends(Fl_JPEG_Image,Fl_RGB_Image)
Fl_Extends(Fl_PNM_Image,Fl_RGB_Image)
You can create an Fl_RGB_Image from a buffer with RGB[A] pixels.
Code: Select all
declare function Fl_RGB_ImageNew(byval bits as const any ptr, byval w as long, byval h as long, byval BytesPerPixel as long=3, byval pitch as long=0) as Fl_RGB_Image ptr
I'm sure there are more than one way to get an RGB image from Pixmap image.
Not tested only some ideas:
Set a Fl_Pixmap or any other palette image as a widget image like a Fl_Box and grab it as RGB image.
Or draw a Fl_Pixmap on an Fl_Window or Fl_Widget and grab it as RGB image.
Or draw a Fl_Pixmap directly over an Fl_RGB_Image.
Or let convert (and optional resize) a Fl_Pixmap from the Fl_Shared_Image class.
...
I will give it a try but not before the weekend.
By the way Icons should have transparent pixels where no colored pixel are set.
This is why the red book image looks not so nice as window icon.
I put "png_with_pink_to_png_alpha.bas" in the media folder.
You can load any BMP, TGA, PNG, JPG, DDS, Tiff or PCX image with pink pixels
and create an png image where pink pixels becomes full transparent.
For example if you have a round shape draw all pixels outside the circle as pink and convert it as png with alpha channel.
Or use an good image editor like GIMP to create transparent regions in the image.
bla bla bla :-)
Joshy