Greg Ercolano schrieb:
> On 02/20/12 10:45, Domingo Alvarez Duarte wrote:
>> The actual printing capabilities of fltk is a great advance, but the
>> quality of image printing isn't all good because it's using screen
>> resolution to print, there is a way to allow higher resolutions for
>> printing ?
Think, I posted it before, but this is the way I used, to map output
from screen resolution to "printed sheet resolution". This is for
printing a data sheet with a graph, all realised with fl_draw-functions
(so no widgets are drawn). This works fine for me.
Fl_Printer * p = new Fl_Printer();
int ww= pWindow->w();
int wh= pWindow->h();
int pw, ph;
if (!p->start_job(1))
{
p->start_page();
if (!p->printable_rect(&pw, &ph))
{
int left, top, right, bottom;
p->margins (&left, &top, &right, &bottom);
pw-= 2* left;
ph-= 2* top;
left*= 2;
top*= 2;
float sw= float(pw)/float(ww);
float sh= float(ph)/float(wh);
if (sw > sh) sw= sh;
p->scale(sw);
p->print_widget(pWindow, left, top);
}
p->end_page();
p->end_job();
}
delete p;
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk