Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Drawing on Printer vs Display


GEF comes with a plug-in called draw2d.  One of the items included is a more convenient GC class called Graphics.  Graphics support scaling, pushing and popping of state, and most importantly, there is a version which translates Display resources to Printer resources on-the-fly, and caches them until you dispose the Graphics.

Even if you don't use GEF, looking at the code (PrinterGraphics) might help you figure out what to do.  Of course, you shouldn't copy significant parts of the code unless you plan to make your copy available under CPL.

On windows, you can use a Display (logical?) font on the Printer.  But I don't think this will work on other platforms.

-Randy



Sebastian Ferreyra <sebastianf@xxxxxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

08/28/2003 06:29 PM
Please respond to platform-swt-dev

       
        To:        platform-swt-dev@xxxxxxxxxxx
        cc:        
        Subject:        [platform-swt-dev] Drawing on Printer vs Display



Hi, I would like to know how important it is to properly create colors
and fonts
on the GC currently being drawn to.

As far as I can tell (I haven't looked in depth yet) when you call
setForeground
or setBackground on a GC it does not check to see if the Color belongs
to the
same device as the GC. I haven't checked this for Font yet.

I could test this to see wheter it works or not. But I'm interested in
knowing about
the design intent behind the functionality. As I said, I haven't checked
in depth but
in many places SWT itself appears not to care.

To summarize with an example, may I and more importantly SHOULD I use
Colors
created on a Display device in Printer.setForeground( .. )?

Any comments would be appreciated.

Seb


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top