|
When I try to link in an Image, I add the x, y, width,
height, and xlink:href attribute. When I place the Element on the JSVGCanvas,
I get an error telling me that xlink:href is required. I do have it as I can
verify by viewing the source of my document: <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="">
id="59FAB452-F82B-9202-6A5C-226937440F88" transform="translate(0, 0) scale(1, 1)"
width="130" xlink:show="embed"
xlink:type="simple" preserveAspectRatio="xMidYMid meet"
height="100" x="21" y="312" xlink:actuate="onLoad"/> The odd thing is, I did NOT add the “xmlns:xlink”
attribute, the “xlink:show”, “xlink:type”, or “xlink:actuate”
attributes. The xlink:href is clearly there so maybe I’m doing something
wrong. Here’s the code snippet: element =
SVGDocumentManager.createElement(SVGConstants.SVG_IMAGE_TAG); String xCoordinate =
String.valueOf(Status.getXCurrent()); String yCoordinate =
String.valueOf(Status.getYCurrent()); String width = String.valueOf(ImageStatus.getWidth()); String height =
String.valueOf(ImageStatus.getHeight()); String imageName =
ImageStatus.getImageFile().getName(); element.setAttribute(SVGConstants.SVG_X_ATTRIBUTE,
xCoordinate); element.setAttribute(SVGConstants.SVG_Y_ATTRIBUTE,
yCoordinate);
element.setAttribute(SVGConstants.SVG_WIDTH_ATTRIBUTE, width);
element.setAttribute(SVGConstants.SVG_HEIGHT_ATTRIBUTE, height); element.setAttribute("xlink:href",
imageName); Michael Bishop |
Error importing Images into an image tag?
Bishop, Michael W. CONTR J9C880 Wed, 30 Nov 2005 07:53:23 -0800
- Error importing Images into an image tag? Bishop, Michael W. CONTR J9C880
- Re: Error importing Images into an im... Archie Cobbs
- RE: Error importing Images into an im... Bishop, Michael W. CONTR J9C880
- Re: Error importing Images into a... Archie Cobbs
- RE: Error importing Images into an im... Bishop, Michael W. CONTR J9C880
- RE: Error importing Images into an im... Bishop, Michael W. CONTR J9C880
- RE: Error importing Images into a... Tonny Kohar
- RE: Error importing Images into an im... Bishop, Michael W. CONTR J9C880
- RE: Error importing Images into a... thomas . deweese
- RE: Error importing Images into a... Tonny Kohar
- RE: Error importing Images into an im... Bishop, Michael W. CONTR J9C880
