Java XMLStreamWriter CreateSimpleImage(XMLStreamWriter serializer, URL url, int w, int h)

Here you can find the source of CreateSimpleImage(XMLStreamWriter serializer, URL url, int w, int h)

Description

Create Simple Image

License

Open Source License

Declaration

public static XMLStreamWriter CreateSimpleImage(XMLStreamWriter serializer, URL url, int w, int h)
            throws XMLStreamException 

Method Source Code

//package com.java2s;
//   Licensed under the Apache License, Version 2.0 (the "License"); you may

import java.net.URL;

import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

public class Main {
    public static XMLStreamWriter CreateSimpleImage(XMLStreamWriter serializer, URL url, int w, int h)
            throws XMLStreamException {
        serializer.writeStartElement("img");
        serializer.writeAttribute("src", url.toString());
        if (w != 0)
            serializer.writeAttribute("width", String.valueOf(w));
        if (h != 0)
            serializer.writeAttribute("height", String.valueOf(h));
        //serializer.writeEndElement();
        return serializer;
    }//from  ww  w .  j a  va 2  s. co m
}

Related

  1. addObjectId(final XMLStreamWriter writer, final String objId)
  2. CloseNewHTML(XMLStreamWriter serializer)
  3. closeQuietly(XMLStreamWriter c)
  4. copy(Reader reader, XMLStreamWriter xmlStreamWriter)
  5. CreateColumn(XMLStreamWriter serializer, String w, String h)
  6. CreateSimpleTagAndContent(XMLStreamWriter serializer, String tag, String content)
  7. CreateTable(XMLStreamWriter serializer)
  8. createXMLStreamWriter(StringWriter outWriter)
  9. exportCoordinateList(XMLStreamWriter writer, List coordinates, String separator)