You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by JJ Rock <jj...@yahoo.com> on 2005/11/16 13:56:40 UTC

Batik Question

Hi All,
  
  Does the JSVGCanvas have the ability to select the rendering  mode?  For instance, I want to select between low quality  (aliased) mode for editing and high quality mode for  presentation.  Is this possible?  Googled for a few different  search terms and didn't find anything, but maybe I'm not looking by the  right words.
  
  Thanks,
  JJ
  

		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

Re: Batik Question

Posted by th...@kodak.com.
Hi JJ,

JJ Rock <jj...@yahoo.com> wrote on 11/16/2005 07:56:40 AM:

> Does the JSVGCanvas have the ability to select the rendering mode?  For 
> instance, I want to select between low quality (aliased) mode for 
editing and 
> high quality mode for presentation.  Is this possible? 

   It is possible although there isn't a simple 'setBaseMode' method.
There are two primary approaches you could take.  The first would be to
twiddle the DOM and simply add the image-rendering, text-rendering, etc
properties to the root of the SVG document to control the rendering mode.
This is as simple as setting a couple of attributes on the DOM.

   The second would be to manipulate the default set of hints on the 
renderer used by the Canvas.  This can be accomplished by subclassing
the canavs and constructing a new set of RenderingHints that you set
on the canvas's renderer (this.renderer.setRenderingHints(newHints)).

   See java.awt.RenderingHints for the available hints.  The default
set of hints is Anti-alias on and interpolation set to bilinear.
Of the two I would lean towards twiddling the default set of hints.

   I should mention that in either case if the SVG document specifies
rendering hints they will 'override' the canvas provided rendering mode.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org