Package org.zkoss.zkforge.clipboard
Class ClipboardImage
- java.lang.Object
-
- org.zkoss.zkforge.clipboard.ClipboardResult
-
- org.zkoss.zkforge.clipboard.ClipboardImage
-
public class ClipboardImage extends ClipboardResult
Result object for image-based clipboard operations. Read-only.Contains image-specific properties such as MIME type, image dimensions, and binary image data.
-
-
Constructor Summary
Constructors Constructor Description ClipboardImage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHeight()Gets the image height in pixels.byte[]getImageData()Gets the binary image data from the clipboard.StringgetMimeType()Gets the MIME type of the clipboard image.longgetSize()Gets the size of the image data in bytes.intgetWidth()Gets the image width in pixels.booleanhasImageData()Checks if this result contains valid image data.booleanisSupportedFormat()Checks if the image is of a supported format based on MIME type.-
Methods inherited from class org.zkoss.zkforge.clipboard.ClipboardResult
getAction, getError, isSuccess, setError
-
-
-
-
Method Detail
-
getMimeType
public String getMimeType()
Gets the MIME type of the clipboard image.- Returns:
- the image MIME type (e.g., "image/png", "image/jpeg"), or null if no image data
-
getImageData
public byte[] getImageData()
Gets the binary image data from the clipboard.- Returns:
- the image data as a byte array, or null if no image data or error occurred
-
hasImageData
public boolean hasImageData()
Checks if this result contains valid image data.- Returns:
- true if image data is available and the operation succeeded, false otherwise
-
getWidth
public int getWidth()
Gets the image width in pixels.- Returns:
- the image width, or 0 if not available
-
getHeight
public int getHeight()
Gets the image height in pixels.- Returns:
- the image height, or 0 if not available
-
getSize
public long getSize()
Gets the size of the image data in bytes.- Returns:
- the image size in bytes, or 0 if not available
-
isSupportedFormat
public boolean isSupportedFormat()
Checks if the image is of a supported format based on MIME type.- Returns:
- true if the image format is supported, false otherwise
-
-