Re: [fltk.bugs] Permission to translate your page athttp://fltk.org/
2 weeks ago I have asked for your permision to translate your web page and I didn=92t hear any from you since. The problem is that the fltk.bugs forum/mailing list is not intended for direct input from users, but provides feedback from the software trouble reporting system. Therefore not many people read fltk.bugs. You might get a better response by posting in fltk.general instead. ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
[fltk.general] Bargraph object with Fl_Group
Hi all, I am trying to create a simple object representing a bargraph. It is a simple filled rectangle, derived in a Fl_Group ; the draw method simply draw two rectangles, one with fill color, the other with background color. All is ok ; now I want to add a transparent background option. I cannot draw the background rectangle, so when the rectangle is growing all is right, but when the bargraph value goes down... How can I force the erasing of the filled rectangle before redrawing it with the new dimension ? Any suggestion is welcome. Thanks all, regards Lucio Dona' ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
[fltk.general] R: Bargraph object with Fl_Group
Ok, ok, it's Friday, need more sleep. Simply forced redraw() of the parent solved the problem. It's a bit inefficient, because if the parent is a big window with many objects I have to redraw everything. Masked by redrawing only when the bargraph value changes, for now. Any way to invalidate to the parent only the bargraph area ? Thanks, regards Lucio Messaggio originale Da: memoryl...@tin.it Data: 15-mar-2013 10.34 A: fltk@easysw.com Ogg: Bargraph object with Fl_Group Hi all, I am trying to create a simple object representing a bargraph. It is a simple filled rectangle, derived in a Fl_Group ; the draw method simply draw two rectangles, one with fill color, the other with background color. All is ok ; now I want to add a transparent background option. I cannot draw the background rectangle, so when the rectangle is growing all is right, but when the bargraph value goes down... How can I force the erasing of the filled rectangle before redrawing it with the new dimension ? Any suggestion is welcome. Thanks all, regards Lucio Dona' ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] R: Bargraph object with Fl_Group
Simply forced redraw() of the parent solved the problem. It's a bit inefficient, because if the parent is a big window with many objects I have to redraw everything. Masked by redrawing only when the bargraph value changes, for now. Any way to invalidate to the parent only the bargraph area ? Derive a widget from Fl_Box to draw your graph, and have its handle method do the actual drawing etc. Set the boxtype of your derived widget to a BOX rather than a FRAME type (and certainly NOT to NO_BOX) and then the background should be handled automatically. FL_FLAT_BOX is probably favourite for this sort of thing. Deriving from group is probably a Bad Thing here, since IIRC the default boxtype for a group is NO_BOX, which probably explains the behaviour you are seeing? Indeed, simply setting the boxtype of your group might actually help... Selex ES Ltd Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL A company registered in England Wales. Company no. 02426132 This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] R: Bargraph object with Fl_Group
thanks for your answer. I am writing to you directly, Best not - I very seldom reply to off-list posts... will post solutions on list ; for now maybe there is a bit of misunderstanding, I try to explain better. The object is a bargraph, let's assume the classic vertical one ; a green rectangle on a white background. Can derive from Fl_Group or, better as you say, from Fl_Box. The problem comes when I want the white background to be invisible: I would like to see a green rectangle growing or shrinking representing a tank level. If the background is invisible I can place the object over a photo of a plant, for example. OK: Then you need to composite the bar graph on top of the image. Fltk does not provide support for transparent widgets (yet) as it is a hard thing to do in a consistent cross-platform way, so the best bet may be for you to just blit the image into the box, then render the bar on top of it. This is easy and cheap to do, if you are rendering the graph on top of an image your app owns. If you want to render the graph transparently on top of (for example) the desktop then you are on your own out there, since fltk can't really do that without a lot of platform specific code...! Hope that made sense! FWIW, I think Greg's cheat pages have examples of doing some of this, so it would be worth a look... http://www.seriss.com/people/erco/fltk/ Selex ES Ltd Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL A company registered in England Wales. Company no. 02426132 This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
[fltk.general] R: Re: R: Bargraph object with Fl_Group
Hi Ian, thanks for your answer. I am writing to you directly, Best not - I very seldom reply to off-list posts... Sorry, will post to the list. OK: Then you need to composite the bar graph on top of the image. Fltk does not provide support for transparent widgets (yet) as it is a hard thing to do in a consistent cross-platform way, so the best bet may be for you to just blit the image into the box, then render the bar on top of it. This is easy and cheap to do, if you are rendering the graph on top of an image your app owns. If you want to render the graph transparently on top of (for example) the desktop then you are on your own out there, since fltk can't really do that without a lot of platform specific code...! Hope that made sense! FWIW, I think Greg's cheat pages have examples of doing some of this, so it would be worth a look... http://www.seriss.com/people/erco/fltk/ I need a bit of thinking. I am writing an app for creating supervision screens on an embedded platform. All is ruled by a configuration text file : it is parsed from my program which then creates all the pages, the buttons for page jumps, the graphics objects and so on. In general I do not know what there will be under my bargraph : maybe a picture, maybe a filled background. The situation is more similar to the desktop you mentioned. For now the simplest solution I can imagine is to redraw the whole parent of my object. Thanks a lot for your observations, regards Lucio ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] R: Re: R: Bargraph object with Fl_Group
On 03/15/13 08:02, memoryl...@tin.it wrote: I need a bit of thinking. I am writing an app for creating supervision screens on an embedded platform. All is ruled by a configuration text file : it is parsed from my program which then creates all the pages, the buttons for page jumps, the graphics objects and so on. In general I do not know what there will be under my bargraph : maybe a picture, maybe a filled background. The situation is more similar to the desktop you mentioned. For now the simplest solution I can imagine is to redraw the whole parent of my object. Thanks a lot for your observations, If the image is assigned to the bargraph's group, then just telling the bargraph widget to redraw() will do it. But if the image is assigned to the parent window, then you'll have to tell the parent window to redraw. Be sure to use an Fl_Double_Window to prevent flickering during redraws. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] R: Re: R: Bargraph object with Fl_Group
On 15 Mar 2013, at 15:02, memoryl...@tin.it wrote: In general I do not know what there will be under my bargraph : maybe a picture, maybe a filled background. The situation is more similar to the desktop you mentioned. So long as the background is drawn by your app, then it is feasible to composite the bar graphs and etc on top of it. But: If the background is drawn by some other app, or is otherwise outside the control of your app windows, then compositing the graphs and so forth on top becomes Very Tricky. For now the simplest solution I can imagine is to redraw the whole parent of my object. Quite possibly: I think we need to understand more about the nature of the backgrounds, how they are drawn etc, and from there we can figure out how to render the graphs on top of them... ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
[fltk.general] Alpha blending with Fl_PNG_Image
I've been working on a widget that can show images zoomed in and out at arbitrary percentages, and that part works. Now, in the middle of my ::draw() function I want to overlay some RGBA PNG images -- these have transparency where I'd like the underlying image to show up. I can make the images show up in the right places, but the alpha channel is being completely ignored in this little snippet: void *baseaddr = (void *)(head-image_-data()[0]); int imagew = head-image_-w(); int imageh = head-image_-h(); int imaged = head-image_-d(); fl_draw_image((const uchar *)baseaddr, x, y, imagew, imageh, imaged); head-image_ in this case was an Fl_PNG_Image that should have 4 channels. It has been cast into an Fl_RGB_Image, which should be a compatible type. But alpha blending isn't happening. I'm getting white where there should be transparency to the pixels previously drawn in the buffer. Instead, I should be getting a blend using the variable opacity in the A channel. Upon further investigation, the documentation says that the only way to get transparency (and 100% transparency at that) is with an Fl_Pixmap (say, a GIF file), and that is definitely NOT RGB. Even so, would that work where this fails, albeit without the kinds of shadows I'm trying to cast in the PNGs? The documentation also points out a function called fl_read_image() where I could copy out the area underneath where the PNG is destined to be drawn. Therefore I could do the alpha blend myself and then do a regular fl_draw_image() to put the blended image in place. Is this the only way it will work? Please advise. -Chris P.S. I deeply appreciate your help earlier when I needed to split my Photoshop plug-in into a stub plug-in and then an .exe. Works like a champ. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk