DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2310
Version: 1.3-feature


It's great !

I started testing the first version (on Windows only), but didn't find the
time to write my comments here.  The lack of "normal" FLTK clipping was the
most problematic point and I thought about the need for better scaling
(other than the matrix functions) and positioning.  I tried (and
succeeded) drawing normal widgets and even the whole program window with
some tricks, but the failed clipping made it unusable for general
functions (e.g. missing text in the sliders).

This is all solved with version 2 :-)  Really good work so far!

Version 3 added a simplification for widget printing, but I found that I
would often need x/y position parameters, if I wanted to draw widgets
without calling setorigin() frequently or messing with the widget
coordinates (that were taken from an ordinary, existing window). Thus I
added this in my test program (for version V2):

static void print_widget (Fl_Widget *w, int X, int Y)
{
  int ox = w->x();
  int oy = w->y();
  w->position(X,Y);
  w->damage(FL_DAMAGE_ALL);
  w->draw();
  w->position(ox,oy);
}

This ensures that widgets can be drawn at arbitrary positions in the print
area (X and Y are relative to setorigin()).  The position is restored after
draw() to be sure.  AFAICT this doesn't work for windows though (x/y
coordinates are ignored); therefore it might be better to adjust the
widget positions by changing the origin accordingly in
Fl_Native_Printer::printwidget().  Maybe.

It would also be a good extension to have a method to get the current
x_/y_offset (origin) for applications.

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. Look for

porsche.cxx  - the demo source
porsche.pdf  - the output when printing only page 2 (of 3 identical pages)

You will need test/pixmaps/porsche.xpm for it to work.

More comments to follow in a different posting.


Link: http://www.fltk.org/str.php?L2310
Version: 1.3-feature

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

Reply via email to