Icon/native image options in Linux

Linux specific forum
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Icon/native image options in Linux

Post by Keya »

Hello im wondering what available options there are for icons or native images in Linux? in particular icon-style images for buttons, so... small and transparent backgrounds.

We can't use Windows .ICO or Mac .ICNS files, i understand that

We can use Windows BMP, but the 32bit ELF is 59kb to display a 1kb BMP, and there is no transparency? I tried a 32bit BMP with alpha channel but the transparency appeared yellow, but ive only tried that once

We can use PNG, but requiring the codec makes the 32bit ELF 166kb to display a 1kb PNG, and when I tried both 8bit and 24bit PNG neither correctly displayed the transparency (im assuming thats a bug? as transparency worked fine in the IDE, just not compiled)
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Icon/native image options in Linux

Post by Fred »

You need to use a 32 bit PNG if you want transparency. Is 166kb really an issue ?
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Icon/native image options in Linux

Post by Keya »

You need to use a 32 bit PNG if you want transparency.
I see. I couldn't see any mention in the helpfile btw, the UsePNGDecoder() page doesn't even mention bits, and the LoadImage() page is very vague about alpha channel and doesn't specify that PNG need to be 32bit.

Also, the 8-bit and 24-bit PNGs display transparency correctly on Windows and Mac (both IDE + compiled), and in Linux (in IDE), which is why i assumed it's just a Linux-only bug

Actually the helpfile's one and only mention of 32-bit confused me into thinking it was for 32-bit bitmap-with-alpha-channel support, but 32-bit BMP doesn't appear to be supported by Purebasic (it displays but the transparency isn't rendered).

Both 8-bit and 24-bit PNG support transparency at much smaller filesize, why only support 32-bit? I hadnt even tried 32bit as my Photoshop only exports 8 and 24. Are there any plans to support 8 and 24? Especially as all I need is small images for buttons, 32-bit is unnecessarily bloated and visually virtually no different compared to 24-bit while letting me keep filesize to a minimum. (and why does the transparency work fine with 8/24-bit PNG in the IDE - just not the compiled ELF?)
Is 166kb really an issue ?
Well 1) i'm just not sure what I'm supposed to tell people when they ask "why is the Linux version 166kb when the Windows version is 20kb?" "So i can show the same button icons" seems a strange unprofessional reply, and might have some people questioning "what else have they bundled into the Linux version that isnt in the Windows? something suspicious we're not being told!?" (its 2015, a lot of ppl are security-wary about such things!)

and 2) it just seems a lot more naturally efficient to use a native image format (like we can with ICO or BMP on Windows, or ICNS on Mac), and let the OS or framework like Gtk do the job, rather than having to include 166kb worth of codec just to display a 1kb image. Is there not a Gtk or OS API Purebasic can call upon like it's doing with ICO and ICNS?

Thankyou :)
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 544
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: Icon/native image options in Linux

Post by bbanelli »

Keya wrote:Well 1) i'm just not sure what I'm supposed to tell people when they ask "why is the Linux version 166kb when the Windows version is 20kb?"
You are not supposed to hang out with people asking such questions, rendering phrase "there is no such thing as a stupid question" invalid.

They will never know what have you "bundled" if you don't provide source code anyway, regardless of executable size.

That being said, pray to God they never find out that you use PB in the first place - who knows what did Fred&Co. wrapped around functions that you use everyday... :twisted:
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Icon/native image options in Linux

Post by Keya »

You are not supposed to hang out with people asking such questions
well i don't plan to hang out with anyone using my software heehee, but i do have to answer every question they throw at me, including any stupid ones like the ones i ask Fred :)
but getting back to the topic... :)
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Icon/native image options in Linux

Post by Keya »

I found this Purebasic Linux demo by RE-A which sets the minimized window icon - http://purebasic.fr/english/viewtopic.php?f=12&t=40077
As you can see the code is beautifully simple and appears to use a native linux image type of some sort - i think this is exactly the sort of thing i'm after to display transparent icons on Button gadget??? and it supports RGBA/alpha channel!

Code: Select all

Structure PixData
  magic.l
  length.l
  pixdata_type.l
  rowstride.l
  width.l
  height.l
  pixel_data.l
EndStructure

ImportC ""
  gtk_window_set_icon(a.l, b.l)
  gdk_pixbuf_from_pixdata(a.l, b.l, c.l)
EndImport

Procedure SetWindowIcon(iWindow.i)
  Protected mIcon.PixData
  mIcon\magic = $47646B50
  mIcon\length = 749
  mIcon\pixdata_type = $2010002
  mIcon\rowstride = 64
  mIcon\width = 16
  mIcon\height = 16
  mIcon\pixel_data = ?WindowIcon

  lPixbuf.l = gdk_pixbuf_from_pixdata(mIcon, #False, lError.l)
  gtk_window_set_icon(WindowID(iWindow), lPixbuf)
EndProcedure

#frmTest = 1000
If OpenWindow(#frmTest, 50, 50, 150, 50, "Icon Test", #PB_Window_SystemMenu|#PB_Window_TitleBar|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
  SetWindowIcon(#frmTest)
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
End

DataSection
  WindowIcon:
    Data.a 134,255,255,255,0,4,37,37,39,162,36,36,37,249,40,40,40,240,49,49,59,115,139,255,255,255,0,6,39,39,39,72
    Data.a 36,36,36,254,36,36,36,255,40,40,40,255,50,50,50,255,37,37,42,95,138,255,255,255,0,6,39,39,42,123,56,56
    Data.a 57,255,42,44,45,255,60,61,62,255,45,45,46,255,36,36,36,183,138,255,255,255,0,6,45,45,53,103,86,82,74,255
    Data.a 216,213,199,255,187,185,177,255,65,65,65,255,36,36,36,194,138,255,255,255,0,7,39,39,45,77,207,178,47,255,252,221
    Data.a 47,255,247,215,48,255,131,112,52,255,36,38,47,209,37,37,39,8,137,255,255,255,0,7,41,42,46,97,190,174,111,255
    Data.a 225,194,70,255,234,208,122,255,127,125,121,255,49,49,52,255,37,37,39,83,136,255,255,255,0,9,36,36,36,39,110,110
    Data.a 111,224,243,244,246,255,230,229,231,255,252,254,255,255,194,194,193,255,45,45,45,255,36,36,36,214,38,38,39,27,134,255
    Data.a 255,255,0,11,37,37,39,2,36,36,36,189,177,177,177,255,255,255,255,255,252,252,253,255,252,252,252,255,241,241,240,255
    Data.a 66,66,67,255,36,36,36,255,37,37,39,180,38,38,39,1,133,255,255,255,0,4,36,36,36,56,86,86,87,252,243,243
    Data.a 241,255,255,255,254,255,130,253,253,252,255,5,255,255,254,255,195,195,194,255,56,56,56,255,39,39,39,254,37,37,39,65
    Data.a 133,255,255,255,0,6,36,36,36,151,165,165,165,255,255,255,255,255,249,249,247,255,252,252,251,255,253,253,252,255,130,255
    Data.a 255,254,255,3,81,81,81,255,36,36,37,255,36,36,39,131,132,255,255,255,0,12,39,37,41,28,50,49,48,240,191,191
    Data.a 194,255,255,255,255,255,247,247,246,255,252,252,250,255,253,253,252,255,255,255,253,255,255,255,255,255,93,93,94,255,36,36
    Data.a 36,255,36,36,39,148,131,255,255,255,0,13,197,155,46,19,180,140,46,98,208,167,40,252,164,152,112,255,230,232,239,255
    Data.a 253,253,252,255,252,252,250,255,253,253,252,255,255,255,255,255,253,207,83,255,96,85,45,255,36,36,39,255,109,96,45,154
    Data.a 131,255,255,255,0,14,216,171,50,176,248,199,45,255,255,207,46,255,201,161,36,255,83,81,75,255,212,213,216,255,255,255
    Data.a 255,255,255,255,254,255,250,253,255,255,246,190,54,255,226,164,39,255,201,145,40,255,245,180,41,236,243,176,44,84,130,255
    Data.a 255,255,0,6,221,172,46,180,252,203,46,255,248,197,45,255,254,199,42,255,156,130,51,255,200,202,207,255,130,255,255,255
    Data.a 255,6,177,179,186,255,188,141,51,255,255,188,40,255,255,188,41,255,254,188,41,255,237,171,44,216,130,255,255,255,0,14
    Data.a 210,159,44,208,234,181,45,255,243,189,45,255,254,199,45,255,235,179,47,255,124,114,95,255,113,114,118,254,90,90,91,254
    Data.a 39,39,43,255,136,101,38,255,255,190,42,255,246,179,42,255,203,139,42,191,182,118,48,69,130,255,255,255,0,6,167,121
    Data.a 42,20,149,109,41,74,141,106,41,133,167,121,42,206,142,105,40,225,53,46,37,57,130,36,36,36,8,5,36,36,40,13
    Data.a 100,78,42,125,186,126,40,247,159,105,41,146,129,90,41,2,130,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0
    Data.a 0,0,0,0,0,0,0,0,208,142,175,8,0,0
EndDataSection
That looks very similar to using a normal Windows .ico!
[edit] IMPORTANT: The above demo uses 'gdk_pixbuf_from_pixdata' ... as far as i know all the pixdata functions have been deprecated. To clarify, pixbuf is fine, but pixdata is deprecated.

And a followup post in same thread suggests its even easier, as "PB-Image is compatible to gtk-pixbuffer":

Code: Select all

#frmTest = 1000
If OpenWindow(#frmTest, 50, 50, 150, 50, "Icon Test", #PB_Window_SystemMenu|#PB_Window_TitleBar|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
  gtk_window_set_icon_(WindowID(#frmTest), CatchImage(0, ?WindowIcon))
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
End

DataSection
  WindowIcon:
    Data.a 134,255,255,255,........-cut-
EndDataSection

So i noticed "mIcon\magic = $47646B50", which in ascii is "GdkP", so i googled for that and found amongst other things this page
https://developer.gnome.org/gdk-pixbuf/ ... -data.html

So am I on the right track here????? can we use this approach to set a transparent icon (not png) on a button in Linux? (and if it is this easy could it possibly become a native part of Purebasic?)

ps. i just also found this demo http://stackoverflow.com/questions/1412 ... rom-memory
Entire code:

Code: Select all

#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>

void on_destroy (GtkWidget *widget G_GNUC_UNUSED, gpointer user_data G_GNUC_UNUSED)
{
    gtk_main_quit ();
}

int main (int argc, char *argv[]) 
{
    FILE *f;
    guint8 buffer[100000];
    gsize length;
    GdkPixbufLoader *loader;
    GdkPixbuf *pixbuf;
    GtkWidget *window;
    GtkWidget *image;
    gtk_init (&argc, &argv);
    f = fopen ("test.jpg", "r");
    length = fread (buffer, 1, sizeof(buffer), f);
    fclose (f);
    loader = gdk_pixbuf_loader_new ();
    gdk_pixbuf_loader_write (loader, buffer, length, NULL);
    pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    image = gtk_image_new_from_pixbuf (pixbuf);
    gtk_container_add (GTK_CONTAINER (window), image);
    gtk_widget_show_all (GTK_WIDGET (window));
    g_signal_connect (window, "destroy", G_CALLBACK(on_destroy), NULL);
    gtk_main ();
    return 0;
}
which loads "test.JPG", so perhaps we can also use this approach to load PNG without requiring PNGDecoder?
Last edited by Keya on Sun Sep 20, 2015 11:21 am, edited 2 times in total.
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Icon/native image options in Linux

Post by Keya »

so can anyone confirm if im at least on the right track here? (in regards to being able to use these gtk api to display an icon on my button in my Purebasic linux app)
Im more than willing to spend the time, i just dont want to waste it if its its already known to be a deadend road :)
Thankyou
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Icon/native image options in Linux

Post by Trond »

You can use gdk_pixbuf_new_from_file() (must be imported manually) or gtk_image_new_from_file_() (creates an image gadget).

IMO you shouldn't both with .ico files on Linux. Use png if you want transparency. This requires that GDK is compiled with support for png, which I think is a fair assumption.

A problem with gdk/gtk functions is that they require strings in UTF-8 format. Just keep that in mind.
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Icon/native image options in Linux

Post by Keya »

You can use gdk_pixbuf_new_from_file() (must be imported manually) or gtk_image_new_from_file_() (creates an image gadget).
Ok great, thanks! im excited that this appears to be a "correct avenue" i can use (i was a bit worried due to lack of feedback i might be going down a dead-end road!)

I'll try those from-file methods first, should be the easiest to test it works ok. And then when I get that far i can try out the from-memory versions :)
IMO you shouldn't both with .ico files on Linux. Use png if you want transparency.
In the demo above it uses some sort of "GdkP" icon format (thats the first 4 magic bytes anyway), exactly what filetype it is im not sure (perhaps it's PNG data after that! im not sure yet, much testing to do), but im guessing/hoping at this stage i can possibly use GIMP to convert .ICO/.ICNS/.SVG/.PNG (any will do) to this "GdkP" format. Or if not that, then perhaps theres gtk api for conversion.

I can also use PNG if these Gtk API accept it, which it seems to. The only reason I was hoping to avoid PNG is because i only have two 1kb icons, and it seems inefficient to require ~160kb worth of UsePNGDecoder() just to display two tiny icons (especially when no PNG decoder is required on Win/Mac due to native .ICO/.ICNS support), but that's not an issue if the Gtk API has its own PNG decoder.

This seems like the sort of thing Purebasic should natively support though?
A problem with gdk/gtk functions is that they require strings in UTF-8 format.
Shouldn't be a problem now i know about it, thanks :)

Ok, time to try this puppy!...
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: Icon/native image options in Linux

Post by heartbone »

I use this method.
The PB code that has ;;; at the end of the line is what you need
to make it happen for the launcher button.

Code: Select all

;;; SETUP LINUX ICON CREATION 
UsePNGImageDecoder()   ;;;
ImportC ""   ;;;
   gtk_window_set_icon(a.l,b.l,c.l)  ;;;
EndImport   ;;;
InitSprite()
OpenWindow(0,0,0,800,600,"SOFTWARE",#PB_Window_ScreenCentered)
ICON= CatchImage(#PB_Any,?LINUXICON)   ;;;
gtk_window_set_icon_(WindowID(0),ImageID(ICON))   ;;;
Delay(5000)
End
LINUXICON: : IncludeBinary "linux.png"   ;;;
This may or may not help.
Keep it BASIC.
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Icon/native image options in Linux

Post by Keya »

heartbone, great, thanks! snippets like that are very helpful, because there doesn't seem to be too many lol :)

but your code still calls UsePNGDecoder! ... that's the part im trying to avoid, and im pretty sure but not yet 100% that we can. :) I hope to have a conclusive answer and working demo soon! your demo showing an example gtk call certainly makes that easier so thankyou again :)

http://openbooks.sourceforge.net/books/ ... ixbuf.html
Gdk-pixbuf currently supports PNG, XPM, JPEG, TIFF, PNM, RAS, BMP, and even the patented GIF format. The loaders are easy to write and very modular, so gdk-pixbuf is well equipped to keep pace with new and old image formats alike.
I still also need to work out what this "GdkP" format in one of the above demos is, because that seems it might be the key,
because your code also uses gtk_window_set_icon, but whereas yours loads using PNGDecoder(), their demo uses this:

Code: Select all

  Protected mIcon.PixData
  mIcon\magic = $47646B50   ;"GdkP"
  mIcon\pixel_data = ?WindowIcon
  (a few more mIcon\header fields)
...
  lPixbuf.l = gdk_pixbuf_from_pixdata(mIcon, #False, lError.l)
  gtk_window_set_icon(WindowID(iWindow), lPixbuf)
but then, https://developer.gnome.org/gdk-pixbuf/ ... UMBER:CAPS says that
GDK_PIXBUF_MAGIC_NUMBER is deprecated and should not be used in newly-written code.
And also:
gdk_pixdata_from_pixbuf and gdk_pixbuf_from_pixdata have been deprecated since version 2.32 and should not be used in newly-written code. Use GResource instead.
Hrm :(
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: Icon/native image options in Linux

Post by heartbone »

Keya wrote:heartbone, great, thanks! snippets like that are very helpful, because there doesn't seem to be too many lol :)

but your code still calls UsePNGDecoder! ... that's the part im trying to avoid, and im pretty sure but not yet 100% that we can. :) I hope to have a conclusive answer and working demo soon! your demo showing an example gtk call certainly makes that easier so thankyou again :)
I am glad that it helped.
I hope that your intuition is correct and you can hack some PB code that does not require the PNGDecoder to be included.
Good luck with that.
Keep it BASIC.
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Icon/native image options in Linux

Post by Keya »

SOLUTION FOUND! I found this sample posted just earlier this year by author Omi, full credit and many thanks to them -
http://www.chabba.de/Linux/ButtonGadget ... ddImage.pb

IMPORTANT:
;if icons are not shown, uncomment the following line ...
; ButtonImages_Activate(#True)
i scratched my head for five minutes before noticing that line ... i uncommented and all of a sudden i can see the icons :)
then I wasted another five minutes because of getting the sensitive case of my png filename wrong, Windows is more forgiving of me, whoops :P

Code: Select all

;======================================================================
; Module/File:     Button_AddImage.pb
; Function:        Button: Add loaded or stock-imaged to pb-Button with alignment - Linux
; Author:          Omi
; Date:            Oct. 14, 2014
; Version:         0.3, updt. utf8-handling, activate images in Buttons
; Target Compiler: PureBasic 5.22/5.30
; Target OS:       (X/K)ubuntu 32/64, Ascii/Uni
; License:         Free, unrestricted, no warranty
;======================================================================
 
EnableExplicit
 
ImportC ""
	gtk_button_set_image(*button.GtkButton, *image.GtkWidget)
	gtk_button_set_image_position(*button.GtkButton, position)
	gtk_button_set_label(*button.GtkButton, label.p-utf8)
	gtk_image_clear(*image.GtkWidget)
	gtk_button_set_alignment(*button.GtkButton, xalign.f, yalign.f)
	gtk_image_new_from_stock(stock_id.p-utf8, size)
	gtk_image_new_from_file(filename.p-utf8)
	g_object_set(*object.GObject, property_name.p-utf8, *data, v= 0)
EndImport
 
#MainWin= 0
 
Enumeration
	#myButton1
	#myButton2
	#myButton3
	#myButton4
	#myButton5
EndEnumeration
 
Global.i gEvent, gQuit
Global *image1, *image2, *image3, *image4
 
 
Procedure ButtonImages_Activate(Show)
	g_object_set(gtk_settings_get_default_(), "gtk-button-images", Show, #Null)
EndProcedure
 
Procedure ButtonGadget_AddImage(Gadget, *Pic, Label.s, Alignment)
	gtk_button_set_image(GadgetID(Gadget), *Pic)
	gtk_button_set_label(GadgetID(Gadget), Label)
	gtk_button_set_image_position(GadgetID(Gadget), Alignment)
EndProcedure
 
 
If OpenWindow(#MainWin, #PB_Ignore, #PB_Ignore, 250, 250, "Linux-Test Button with image")
 
	;if icons are not shown, uncomment the following line ...
	; ButtonImages_Activate(#True)
 
	;for loading icons choose your own image-adresses ...
; 	*image1= gtk_image_new_from_file("/home/charly-xubuntu/Programming/PBSource/Icons/Own/Back.png")
; 	*image2= gtk_image_new_from_file("/home/charly-xubuntu/Programming/PBSource/Icons/Own/Find.png")
; 	*image3= gtk_image_new_from_file("/home/charly-xubuntu/Programming/PBSource/Icons/Own/Previous.png")
; 	*image4= gtk_image_new_from_file("/home/charly-xubuntu/Programming/PBSource/Icons/Own/Stop sign.png")
	;or use stock-images ...
	*image1= gtk_image_new_from_stock("gtk-go-back", #GTK_ICON_SIZE_MENU);  #GTK_ICON_SIZE_BUTTON
	*image2= gtk_image_new_from_stock("gtk-find", #GTK_ICON_SIZE_MENU)
	*image3= gtk_image_new_from_stock("gtk-goto-first", #GTK_ICON_SIZE_MENU)
	*image4= gtk_image_new_from_stock("gtk-stop", #GTK_ICON_SIZE_MENU)
 
	ButtonGadget(#myButton1, 5, 5, 200, 30, "   Button with image", #PB_Button_Toggle)
	 ButtonGadget_AddImage(#myButton1, *image1, "1. Button with image", #GTK_POS_LEFT)
	ButtonGadget(#myButton2, 5, 40, 200, 30, "   Button with image")
	 ButtonGadget_AddImage(#myButton2, *image2, "2. Button with image", #GTK_POS_RIGHT)
	ButtonGadget(#myButton3, 5, 75, 200, 50, "   Button with image")
	 ButtonGadget_AddImage(#myButton3, *image3, "3. Button with image", #GTK_POS_TOP)
	ButtonGadget(#myButton4, 5, 130, 200, 50, "   Button with image")
	 ButtonGadget_AddImage(#myButton4, *image4, "4. Button with image", #GTK_POS_BOTTOM)
	ButtonGadget(#myButton5, 5, 185, 200, 50, "Button with alignment", #PB_Button_Right)
 
	gtk_button_set_alignment(GadgetID(#myButton5), 1.0, 1.0);    geht nur über ImportC
 
Else
	End
EndIf
 
Repeat
	gEvent = WaitWindowEvent()
	If EventWindow()= #MainWin
		Select gEvent
			Case #PB_Event_CloseWindow
				gQuit= #True
		EndSelect
	EndIf
Until gQuit
 
;free image-memory...
gtk_image_clear(*image1)
gtk_image_clear(*image2)
gtk_image_clear(*image3)
gtk_image_clear(*image4)
 
End
Ok, now to work on a load-PNG-from-memory version. Getting there! Soon I will be able to display my 1kb PNG with 1kb of code, oh yes, I will! :D
Last edited by Keya on Fri Sep 18, 2015 5:17 pm, edited 2 times in total.
Oma
Enthusiast
Enthusiast
Posts: 312
Joined: Thu Jun 26, 2014 9:17 am
Location: Germany

Re: Icon/native image options in Linux

Post by Oma »

Hi Keya,

i read this thread, but i thought you would keep the pics in the exe (therefore i found no solution without the use of UsePNGImageDecoder()). That's why i gave no Tip.

Please pay attention to this code lines (cause some themes switch it off per default) ...
;if icons are not shown, uncomment the following line ...
; ButtonImages_Activate(#True)
Regards, Charly

PS: Just saw, you've already found it :D
PureBasic 5.4-5.7, Linux: (X/L/K)Ubuntus+Mint - Windows XP (32Bit)
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Icon/native image options in Linux

Post by Keya »

Oma, I take it you're Omi the original author! Thankyou very much for your work :)

Yes I plan to embed the icons in my elf executable. Im pretty sure there are some in-memory versions of these gdk/gtk api?

btw even if i have to store them embedded in my executable as a "bitmap-style" uncompressed image ("pixbuf" or "pixdata" in gtk i think), im fine with that as I can use other decompressors like BriefLZ for example that only adds 10kb to the executable, as opposed to 166kb for UsePNGDecoder

But ideally there'll be a from-memory version of gtk_image_new_from_file (gtk_image_new_from_pixbuf perhaps??) so PNG can be used directly ... or at least that's what im trying to hunt down now :)

ps. special thanks to freak for his excellent blog entry "API Programming: What’s behind the PB GUI objects" http://www.purebasic.fr/blog/?p=336
Post Reply