manolo gouy wrote:
>> Currently not working in my test: Transparency (real alpha or
>> transparent
>> pixels like in Fl_Pixmap).  I didn't test real alpha channel images yet.
>> Is there a chance that transparency can work with printing devices?
>>
>> I'll post my demo program that shows the effect with a pixmap.
> 
> Albrecht: I didn't understand initially why you were mentionning
> transparency because I tried your pixmap example on Mac where
> the pixmap background is correctly replaced by the window background.

Hm, that's why I also posted the .pdf file ;-)

> I have just now run the test on MSWin, and see the point.
> In fact, a bigger problem occurs on Mac: the pixmap disappears
> altogether whenever scaling is applied (although it's perfectly
> reproduced at 1:1 scale, as said above).
> Thus we have to find a way to move transparency from Mac to PC and
> scaling from PC to Mac.
> Could you help on the PC front ?

I can give it a try, but I'm not that familiar with the Windows
GUI functions (that's why I started using FLTK in the first place).
However, when I fixed a bug with transparency (sic!) I learned
much about it. Thus there's a chance that I can help.

But right now and probably during the next 3 or 4 weeks my spare
time will be very limited because of my real life job. And I
would like to solve that Fl_Group::clear() performance problem
if I can...

That said, I suggest that we add a temporary development branch
for Fl_Printer so that we can both work on it and that other
developers or users can easily test it.

If you like that idea, I can do it (or you can do it yourself),
just tell me.

And here's a small patch for Fl_Printer::print_widget()
that I used for my testing:

$ diff -u Fl_Printer.cxx.ori Fl_Printer.cxx
--- Fl_Printer.cxx.ori  2010-02-08 11:30:33.343750000 +0100
+++ Fl_Printer.cxx      2010-02-07 12:11:19.109375000 +0100
@@ -25,7 +25,10 @@
    if ( ! widget->visible() ) return;
    widget->damage(FL_DAMAGE_ALL);
    origin(&old_x, &old_y);
-  origin(old_x + delta_x, old_y + delta_y);
+  if (widget->type()>=FL_WINDOW)
+    origin(old_x + delta_x, old_y + delta_y);
+  else
+    origin(old_x + delta_x - widget->x(), old_y + delta_y - widget->y());
    widget->draw();
    origin(old_x, old_y);
    //find all windows that are within widget, and draw them


[ sorry if it wraps, but I wanted to post it inline ]

This compensates the widget coordinates that *may* be
set in the widget's x() and y(), if it is taken from a
real window. The idea is that the delta_x and delta_y
coordinates are used as the real coordinates, thus
overriding the widget coordinates (otherwise the widget
coordinates would be accumalative). However, we must
not use the x() and y() of real windows, because their
draw() method ignores them.

Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to