Documentation ¶
Overview ¶
Package image is an embedded image component with support for jpg, png, bmp and tiff files.
Index ¶
- type Component
- func (component Component) GetJSONFormat() interface{}
- func (component Component) SetNamedProperties(properties render.NamedProperties) (render.Component, error)
- func (component Component) VerifyAndSetJSONData(data interface{}) (render.Component, render.NamedProperties, error)
- func (component Component) Write(canvas render.Canvas) (render.Canvas, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct { /* NamedPropertiesMap maps user/application variables to properties of the component. This field is filled automatically by VerifyAndSetJSONData, then used in SetNamedProperties to determine whether a variable being passed in is relevant to this component. For example, map[string][]string{"photo": []string{"fileName"}} would indicate that the user specified variable "photo" will fill the Image property via an image file. */ NamedPropertiesMap map[string][]string // Image is the image to draw on the canvas. Image image.Image /* TopLeft is the coordinates of the top-left corner of the image relative to the top-left corner of the canvas. */ TopLeft image.Point // Width is the width to scale the image to. Width int // Height is the height to scale the image to. Height int // contains filtered or unexported fields }
Component implements the Component interface for images.
func (Component) GetJSONFormat ¶
func (component Component) GetJSONFormat() interface{}
GetJSONFormat returns the JSON structure of a image component.
func (Component) SetNamedProperties ¶
func (component Component) SetNamedProperties(properties render.NamedProperties) (render.Component, error)
SetNamedProperties processes the named properties and sets them into the image properties.
func (Component) VerifyAndSetJSONData ¶
func (component Component) VerifyAndSetJSONData(data interface{}) (render.Component, render.NamedProperties, error)
VerifyAndSetJSONData processes the data parsed from JSON and uses it to set image properties and fill the named properties map.
Click to show internal directories.
Click to hide internal directories.