Hello,

Since I have to re-add the image element, it might not be feasible since I
might end up having hundreds of these elements.  So, I tried getting the
renderingTransform before I re-set my canvas so I can still keep my current
view.  However, it doesn't seem to be working.  It seems that my update
manager never gets called.  My code is as follows:

         if (drawingPanel != null) {
//                drawingPanel.refreshCanvas();
                final AffineTransform vbt =
drawingPanel.getCanvas().getRenderingTransform();
                
                System.out.println("vbt: " + vbt);
                drawingPanel.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
                drawingPanel.setSVGDocument(drawing.getSVGDocument());
                final DrawingPanel finalDrawingPanel = drawingPanel;
//                drawingPanel.refreshCanvas();
//                drawingPanel.setRenderingTransform(vbt);
               
finalDrawingPanel.getUpdateManager().getUpdateRunnableQueue().invokeLater(new
Runnable() {
                    public void run() {
                        finalDrawingPanel.setRenderingTransform(vbt);
//                        finalDrawingPanel.refreshCanvas();
                        System.out.println("run: " +
finalDrawingPanel.getRenderingTransform());
                    }
                });
            }

What am I doing wrong?



thomas.deweese wrote:
> 
> Hi VYang,
> 
> vyang <[EMAIL PROTECTED]> wrote on 07/05/2007 11:52:38 AM:
> 
>> I have an image that is linked inside an circle in the canvas.  So then 
> I go
>> and change the image, the link path is still the same(no svg element has
>> been modified).  Now I want the canvas to reflect this change.  Is there 
> a
>> way I can refresh/force refresh the canvas(already dynamic) without 
> having
>> to re-set the canvas document.
> 
>    First call 'dispose' on the DocumentLoader associated with your
> BridgeContext.  The add and reinsert the image element.  This will cause
> Batik to refetch the SVG document.  If the referenced image is raster
> then instead of 'dispose' on the DocumentLoader you need to call
> batik.ext.awt.image.spi.ImageTagRegistery.flushCache()
> 
>    There is a static method to get the global Raster Image cache on
> that class.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Refresh-Image-tf4030613.html#a11631123
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to