Prev: Support for JPEG
Next: Newbie interger question
From: Donal K. Fellows on 20 Jul 2010 06:53 On Jul 12, 11:19 pm, Robert Heller <hel...(a)deepsoft.com> wrote: > At 12 Jul 2010 23:41:43 +0200 ZB <zbTHIS...(a)ispid.THIS-NOcom.pl> wrote: > > > > > Would it be problematic to add to canvas something like "-backgroundimage" > > option (you know, what I mean, there's nothing to explain)? > > > I'm aware, that I can create an image, then place it usual way at specific > > coords - but there's still a question: if canvas can have background filled > > with pixels of the same colour, why not with pixels of different colours? It's never been pressing enough to do anything about, given that putting an image item underneath is trivial to do (and painting a tiled photo image is trivial). > It might also be usefull to do this for frames and toplevels as well, > although it is possible to put an image on a canvas and then treat the > canvas like it was a frame, eg pack'ing or grid'ing child widgets in > it. Now that's a reasonable request, seeing as how that's fairly awkward to do now. Though again, you can work around them using a canvas or label to help. Of more interest I'd have thought is being able to add such things to other widgets so that you can do more subtle effects. Donal.
From: Arndt Roger Schneider on 20 Jul 2010 09:49 ZB schrieb: [snip] >I'm aware, that I can create an image, then place it usual way at specific >coords - but there's still a question: if canvas can have background filled >with pixels of the same colour, why not with pixels of different colours? > > X11 uses 2D hardware acceleration, filling a rectangle with a solid color can be handled by the graphic subssystem. Using an bitmap, will require to prepare the entire bitmap in RAM and then to copy into the graphic buffer. Textures can be handled inside the graphic subsystem as-well today, but this requires direct access to 3D accelerators like xrender/DirectX/CoreGraphics ... or some intermediate layer such as OpenGL or CAIRO... On background bitmaps for containers: Tk has the label window to display images, you can use every window in Tk as a container... even labels. There is one problem with labels as containers: The content (image) in the label propagates its size and thus a propagation lock may arise. Just one property -backgroundimage wouln't suffice, you also need to control where and when the image should be rendered on-screen. -roger
From: Robert Heller on 20 Jul 2010 10:58 At Tue, 20 Jul 2010 15:49:47 +0200 Arndt Roger Schneider <arndt.roger(a)addcom.de> wrote: > > ZB schrieb: > > [snip] > > >I'm aware, that I can create an image, then place it usual way at specific > >coords - but there's still a question: if canvas can have background filled > >with pixels of the same colour, why not with pixels of different colours? > > > > > X11 uses 2D hardware acceleration, filling a rectangle with a solid color > can be handled by the graphic subssystem. > > Using an bitmap, will require to prepare the entire bitmap in RAM > and then to copy into the graphic buffer. > > Textures can be handled inside the graphic subsystem as-well today, > but this requires direct access to 3D accelerators like > xrender/DirectX/CoreGraphics ... > or some intermediate layer such as OpenGL or CAIRO... > > > On background bitmaps for containers: > Tk has the label window to display images, you can use every > window in Tk as a container... even labels. > > There is one problem with labels as containers: > The content (image) in the label propagates its size > and thus a propagation lock may arise. > > Just one property -backgroundimage wouln't suffice, > you also need to control where and when the image should be > rendered on-screen. Probably like CSS's background-image, background-attachment, background-position, and background-repeat: -backgroundimage -backgroundattachment -backgroundposition -backgroundrepeat along with the existing: -background (like CSS's background-color) > > > -roger > > > > -- Robert Heller -- 978-544-6933 Deepwoods Software -- Download the Model Railroad System http://www.deepsoft.com/ -- Binaries for Linux and MS-Windows heller(a)deepsoft.com -- http://www.deepsoft.com/ModelRailroadSystem/
From: Arndt Roger Schneider on 20 Jul 2010 13:09
Robert Heller schrieb: >At Tue, 20 Jul 2010 15:49:47 +0200 Arndt Roger Schneider <arndt.roger(a)addcom.de> wrote: > > > >>ZB schrieb: >> >>[snip] >> >> >> >>>I'm aware, that I can create an image, then place it usual way at specific >>>coords - but there's still a question: if canvas can have background filled >>>with pixels of the same colour, why not with pixels of different colours? >>> >>> >>> >>> >>X11 uses 2D hardware acceleration, filling a rectangle with a solid color >>can be handled by the graphic subssystem. >> >>Using an bitmap, will require to prepare the entire bitmap in RAM >>and then to copy into the graphic buffer. >> >>Textures can be handled inside the graphic subsystem as-well today, >>but this requires direct access to 3D accelerators like >>xrender/DirectX/CoreGraphics ... >>or some intermediate layer such as OpenGL or CAIRO... >> >> >>On background bitmaps for containers: >>Tk has the label window to display images, you can use every >>window in Tk as a container... even labels. >> >>There is one problem with labels as containers: >>The content (image) in the label propagates its size >>and thus a propagation lock may arise. >> >>Just one property -backgroundimage wouln't suffice, >>you also need to control where and when the image should be >>rendered on-screen. >> >> > >Probably like CSS's background-image, background-attachment, >background-position, and background-repeat: > > -backgroundimage > -backgroundattachment > -backgroundposition > -backgroundrepeat >along with the existing: > -background (like CSS's background-color) > > > Shudder; well, you got the picture +add a serious performance penalty to this. Right, there is also a conflict between "backgroundImage" and "background". Perhaps background, highlightBackground, highlightColor, foreground could accept images in addtion to colors? dealing with these images could then be delegated to tk image --surface--, controlled by the <Configure> (<ResizeRequest>,<ConfigureRequest>,<Property>) event. -roger |