Hi Thomas,
Now my offscreen renderer works, I have started to implement the soom and
pan functionality for my display canvas. I think it would be very difficult
to achienve the zoom/pan functionality of JSVGCanvas but I am trying to do
something little close. So, I calculate a scale from the mouse start to end
positions and perform a Scale AffineTransform and update it to the renderer
transform. This is what my code look like:
manager.getUpdateRunnableQueue().invokeAndWait(new Runnable() {
public void run() {
System.out.println("chaning transform");
AffineTransform af =
AffineTransform.getScaleInstance(scale, scale);
af.concatenate(curTxf);
renderer.clearOffScreen();
renderer.setTransform(af);
renderer.repaint(new java.awt.Rectangle
(0, 0, clientDisplaySize.width,
clientDisplaySize.height));
render(renderer.getOffScreen());
curTxf = af;
}
});
But it doesn't seem to work well. Just FYI, my client is a simple PDA that
has a AWT Canvas to display the image rendered at the server. All the
rendering and transformations happen at the server side.
Thanks,
Javid
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 05, 2006 2:42 PM
To: [email protected]
Cc: [email protected]
Subject: RE: Batik offscreen rendering howto?
Hi Javid,
"Javid Alimohideen" <[EMAIL PROTECTED]> wrote on 03/05/2006 03:24:58 PM:
> I had a small bug when I was doing my updates which is fixed now and
works
> great. If I need the offscreen image once the document is fully loaded
and
> rendererd which listeners should I use.
Note that in my update I call:
renderer.repaint(new Rectangle(0, 0, DISPLAY_WIDTH,
DISPLAY_HEIGHT));
After this you can call renderer.getOffscreen() to get the image
before updates.
> Now, I get offscreen images after
> every updates but I would also need the image before I do any updates.
>
> Thanks,
> Javid
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 05, 2006 8:49 AM
> To: [email protected]
> Cc: [email protected]
> Subject: RE: Batik offscreen rendering howto?
>
>
> Hi Javid,
>
> I've created a Wiki page with an example that Works For Me(TM).
>
> http://wiki.apache.org/xmlgraphics-batik/DynamicSvgOffscreen
>
> "Javid Alimohideen" <[EMAIL PROTECTED]> wrote on 03/05/2006 12:38:48
AM:
>
> > I managed to write a simple standalone version of the offscreen
renderer
> > with the updatemanagerlistener. But for some reason, the
updateCompleted
> > method is never called.
>
> I actually don't think there are any really significant changes from
> your original code
> so I am surprised that your stuff didn't work. You might want to look
at
> the main I provided
> as that is where I modify the document. I suspect that you weren't do
> this correctly.
>
>
> > Kindly, excuse me for pasting the entire code as I am not sure
> > if attachments are aloowed.
>
> Generally attachements aren't allowed, you could add the code
> to a Wiki-Page as well.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]