> KN> First I take a screenshot and supposed the size is 800x600 > KN> pixels. > > I guess I don't understand where the screenshot comes in, above it > sounded like you were using the SVGGraphics2D to convert the contents > of your JInternalFrame to SVG.
Yes, I use SVGGraphics2D to generate SVG. > KN> The output raster image size is 400x400 and the contents is > KN> clipped to the size. I supposed giving KEY_WIDTH=800 and or > KN> KEY_HEIGHT=600 would change the clipping size as well as the > KN> output image file size, but what happened with these parameters > KN> was getting the image clipped by 400x400 enlarged to 800x600 size. > KN> I know the 400x400 value is defined at getViewportSize() in > KN> ImageTranscoderUserAgent internal class, but it seems no way to > KN> change it from external. > > I sounds like the SVG you are feeding to the rasterizer isn't set > up properly. In particular you may want to set the viewBox attribute > on the outermost SVG element (to something like: "0 0 600 800"). You > might also set the width and height on the outermost SVG element. I > believe if you used the SVGGraphics2D it should do this for you (not > 100% certain). viewBox attributes seems not to be included SVG generated by SVGGraphics2D. Here is the first lines of the XML. In this case, the desirable graphics size is 675x554. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'> <svg xmlns:xlink="http://www.w3.org/1999/xlink" style="fill-opacity:1; color-interpolation:auto; color-rendering:auto; text-rendering:auto; stroke:black; stroke-linecap:square; stroke-miterlimit:10; stroke-opacity:1; shape-rendering:auto; fill:black; stroke-dasharray:none; font-weight:normal; stroke-width:1; font-family:'Arial'; font-style:normal; stroke-linejoin:miter; font-size:12; image-rendering:auto; stroke-dashoffset:0;" xmlns="http://www.w3.org/2000/svg"> <!--Generated by the Batik Graphics2D SVG Generator--> <defs id="genericDefs" /> <g> <defs id="defs1"> <clipPath clipPathUnits="userSpaceOnUse" id="clipPath1"> <path d="M0 0 L675 0 L675 554 L0 554 L0 0 Z" /> </clipPath> </defs> (snip...) > KN> Do I overlook something? > > I suspect you need to add the viewBox attribute on your outermost > SVG element. Does SVGGraphics2D support adding viewBox attribute? I guess org.batik.util.SVG_VIEW_BOX_ATTRIBUTE might be used to set the value, but no class in svggen package refers it. Thanks, -Kenji Nakamura --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
