- Index
- »
- fan.graphics
- »
- Image
Image
@Js
mixin Image
Graphical image. Images are loaded from a file using GraphicsEnv.image.
Get the natural size of this image
Image format based on file type
Get the size width
Get the size height
Is this image completely loaded into memory for use
Render a new image with the given MIME type and size using the provided Graphics instance
Unique uri key for this image in the GraphicsEnv cache
Write image content to the given output stream, where encoding is based on mime type
virtual Float h()
Get the size height
abstract Bool isLoaded()
Is this image completely loaded into memory for use. When a given uri is first accessed by GraphicsEnv.image it may be asynchronously loaded in the background and false is returned until load is complete.
abstract MimeType mime()
Image format based on file type:
image/pngimage/gifimage/jpegimage/svg+xml
static Image render(MimeType mime, Size size, |Graphics| f)
Render a new image with the given MIME type and size using the provided Graphics instance. Throws UnsupportedErr if rendering is not supported in this env.
abstract Size size()
Get the natural size of this image. If the image has not been loaded yet, then return 0,0.
abstract Uri uri()
Unique uri key for this image in the GraphicsEnv cache.
virtual Float w()
Get the size width
virtual Void write(OutStream out)
Write image content to the given output stream, where encoding is based on mime type. Throws UnsupportedErr if write is not supported in this env.