Lisp HUG Maillist Archive

button image restrictions

Does anyone know offhand what the restrictions are for images used on buttons 
(and / or where this is documented)?  LWL and LWW.

I'm creating 64x64 images using Inkscape and saving them as .png, then 
converting them to .bmp via gimp.

This sequence of commands works, but when the resulting image is used for a 
button, I get two kinds of errors - "invalid DIB" and "other types of images 
are not implemented":

(setq external-image (gp:read-external-image "images/format-box-down.bmp"))
(make-load-form external-image)

thanks
pt


Re: button image restrictions

WRT to my previous email - this may turn out to be an LWL issue.  If I 
generate the image under LWW then move it to LWL, it appears to work.
pt


Re: button image restrictions

Hi,

I encountered some problems when using PNG images, with the same error
message : "other types of images are not implemented". Because in some
sequence of operations LW accepts PNG and in other one it doesn't, I thought
it's maybe a bug. Changing the 'type' slot of the external image to NIL,
makes the PNG image to be accepted (and the transparency normally
managed).So I use this function to replace the
read-and-convert-external-image (and, strangely, it works well) :

(defun read-and-convert-png-image (port file)
  (let ((external-image (gp:read-external-image file)))
    (setf (slot-value external-image 'gp::type) nil)
    (gp:convert-external-image port external-image)))


Best

Denis

Le 18/02/08 18:23, « [NOM] » <[ADRESSE]> a écrit :

> 
> WRT to my previous email - this may turn out to be an LWL issue.  If I
> generate the image under LWW then move it to LWL, it appears to work.
> pt
> 

-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------



Updated at: 2020-12-10 08:44 UTC