This article contains a list of all methods available on main pixie object. For description and method list of various available tools see individual articles for tools:
Methods
applyChanges
-
Parameters
-
Optional panel: DrawerName
Returns void
-
cancelChanges
-
Cancel any pending changes from currently open or specified panel. This is identical to clicking "cancel" button in the editor.
Parameters
-
Optional panel: DrawerName
Returns void
-
close
-
Close editor if it's currently open.
Returns Observable<any>
get
-
Get tool by specified name.
Parameters
-
name: string
Returns void
-
getDefaultConfig
-
Get default configuration without any custom overrides.
Parameters
-
key: string
Returns any
-
getState
-
Get current canvas state as json string.
Parameters
-
Optional customProps: string[]
Returns string
-
getTool
-
Get tool by specified name.
Parameters
-
name: string
Returns void
-
http
-
Get built in http service for making http requests.
Returns HttpClient
isDirty
-
Check if some modifications were made to image, but "apply" button was not clicked yet.
Returns any
loadState
-
Load canvas state from specified json data or url.
Parameters
-
stateOrUrl: string | SerializedCanvas
Returns Promise<any>
-
newCanvas
-
Parameters
-
width: number
-
height: number
Returns Promise<object>
-
notify
-
Display specified notification message on the screen.
Parameters
-
message: string
-
Optional config: ToastConfig
Returns MatSnackBarRef<SimpleSnackBar>
-
on
-
Listen to specified canvas event. (List of all available events can be found in the documentation)
Parameters
-
event: string
-
callback: function
-
-
Parameters
-
e: IEvent
Returns void
-
-
-
Returns StaticCanvas
-
open
-
Open editor if it's currently closed. New configuration can also be optionally specified.
Parameters
-
Optional config: PixieConfig
Returns void
-
openEditorWithImage
-
Open specified image and then editor.
Parameters
-
data: string | HTMLImageElement
-
Default value asMainImage: boolean = true
Returns void
-
openFile
-
Parameters
-
data: string | HTMLImageElement
-
Default value extension: string = "png"
-
Default value asMainImage: boolean = false
Returns Promise<void | Image>
-
openMainImage
-
Open specified photo as main canvas image.
Parameters
-
data: string | HTMLImageElement
Returns void
-
openPanel
-
Open specified editor panel. (Filter, crop, resize etc.)
Parameters
-
name: DrawerName
Returns void
-
resetAndOpenEditor
-
Fully reset and open editor.
Parameters
-
key: string | PixieConfig
-
Optional value: any
Returns Promise<void>
-
resetEditor
-
Fully reset editor and canvas state and optionally override specified configuration.
Parameters
-
key: string | PixieConfig
-
Optional value: any
Returns Promise<unknown>
-
setConfig
-
Override specified configuration. Accepts configuration object or key value pair using dot notation.
Parameters
-
key: string | PixieConfig
-
Optional value: any
Returns void
-
Apply any pending changes from currently open or specified panel. This is identical to clicking "apply" button in the editor.