Package com._1c.g5.v8.dt.ui.util
Class DtImageDataRenderer
- java.lang.Object
-
- com._1c.g5.v8.dt.ui.util.DtImageDataRenderer
-
public class DtImageDataRenderer extends Object
Utility for safety render data inImageDataNote that renderer can convert SVG data to PNG image for showing in SWT widgets
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetFormatName(InputStream imageStream)Tries to retrieve image format name fromInputStreamstatic Optional<org.eclipse.swt.graphics.ImageData>render(byte[] imageBuffer)Render specific source inImageDatastatic Optional<org.eclipse.swt.graphics.ImageData>render(ByteArrayInputStream imageBuffer)Render specific source inImageDatastatic Optional<org.eclipse.swt.graphics.ImageData>render(File file)Render specific source inImageDatastatic Optional<org.eclipse.swt.graphics.ImageData>render(InputStream imageStream)Render specific source inImageData
-
-
-
Method Detail
-
render
public static Optional<org.eclipse.swt.graphics.ImageData> render(ByteArrayInputStream imageBuffer)
Render specific source inImageData- Parameters:
imageBuffer- the source bytes stream, cannot benull- Returns:
- Optional with
ImageData, or empty if specified source inconsistent or cannot be converted to image
-
render
public static Optional<org.eclipse.swt.graphics.ImageData> render(InputStream imageStream)
Render specific source inImageData- Parameters:
imageStream- the source stream, cannot benull- Returns:
- Optional with
ImageData, or empty if specified source inconsistent or cannot be converted to image - See Also:
render(ByteArrayInputStream)
-
render
public static Optional<org.eclipse.swt.graphics.ImageData> render(byte[] imageBuffer)
Render specific source inImageData- Parameters:
imageBuffer- the source byte array, cannot benull- Returns:
- Optional with
ImageData, or empty if specified source inconsistent or cannot be converted to image - See Also:
render(ByteArrayInputStream)
-
render
public static Optional<org.eclipse.swt.graphics.ImageData> render(File file)
Render specific source inImageData- Parameters:
file- the source image file, cannot benull- Returns:
- Optional with
ImageData, or empty if specified source inconsistent or cannot be converted to image - See Also:
render(ByteArrayInputStream)
-
getFormatName
public static String getFormatName(InputStream imageStream) throws IOException
Tries to retrieve image format name fromInputStream- Parameters:
imageStream- image input stream, cannot benull- Returns:
- image format name or empty string if not found
- Throws:
IOException
-
-