Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-03

TBitmap: Loading and drawing

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Weustink
to Marc Weustink: + From: Shane Miller + I attempted to add a function to TBitmap called + LoadFromXPMFile…
Sebastian G|nther wrote
BTW, I hope you all know that X normally only supports bitmaps (=pixmaps with depth 2) and pixmaps with the same colour depth as the current screen uses. You can NOT create pixmaps with an arbitrary colour depth on X!

Yes, we (at least I) already found out as you might recall the problems a while ago in running Lazarus at other screendepths than 8 bpp ;-)

(this is only supported by a few X servers and perhaps by XFree86 4.0); let's see how you want to create a VCL compatible TBitmap class... :-)

We'll see ;-)

Marc

Reply by email

Shane Miller

I attempted to add a function to TBitmap called LoadFromXPMFile to see if I could load an XPM file and use the Speedbutton's canvas to draw it to the button. I failed.. :-(

Can someone look at the code in gtkobject and tell me what the problem is? I am getting a gtk error when I try to load the XPM saying that the assert width != 0 and height !=0 failed. Why are they zero?!!!

Shane

Reply by email

Sebastian Günther
to Marc Weustink: + From: Shane Miller + I attempted to add a function to TBitmap called + LoadFromXPMFile…
Marc Weustink wrote
Yesterday I was struggeling with this also. Somehow it returned a null pixmap.

BTW, I hope you all know that X normally only supports bitmaps (=pixmaps with depth 2) and pixmaps with the same colour depth as the current screen uses. You can NOT create pixmaps with an arbitrary colour depth on X! (this is only supported by a few X servers and perhaps by XFree86 4.0); let's see how you want to create a VCL compatible TBitmap class... :-)

- Sebastian

Reply by email

Marc Weustink
to Shane Miller: I attempted to add a function to TBitmap called LoadFromXPMFile to see if I could load an…

+ From: Shane Miller

+ I attempted to add a function to TBitmap called
+ LoadFromXPMFile to see if I could load an XPM file and use
+ the Speedbutton's canvas to draw it to the button. I failed.. :-( +
+ Can someone look at the code in gtkobject and tell me what
+ the problem is? I am getting a gtk error when I try to load
+ the XPM saying that the assert width != 0 and height !=0
+ failed. Why are they zero?!!!

Yesterday I was struggeling with this also. Somehow it returned a null pixmap.
Finally I got something but is to alpha to commit. I didn't use a LoadFromXPMFile but created a new component TPixmap = class(TBitmap). This way we can use TBitmap for .bmp and TPixmap for .xpm and both can load through streams (etc)
More tonight.

Marc

Reply by email