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

  • Apply any pending changes from currently open or specified panel. This is identical to clicking "apply" button in the editor.

    Parameters

    Returns void

cancelChanges

  • Cancel any pending changes from currently open or specified panel. This is identical to clicking "cancel" button in the editor.

    Parameters

    Returns void

close

  • close(): Observable<any>
  • Close editor if it's currently open.

    Returns Observable<any>

get

  • get(name: string): void
  • Get tool by specified name.

    Parameters

    • name: string

    Returns void

getDefaultConfig

  • getDefaultConfig(key: string): any
  • Get default configuration without any custom overrides.

    Parameters

    • key: string

    Returns any

getState

  • getState(customProps?: string[]): string
  • Get current canvas state as json string.

    Parameters

    • Optional customProps: string[]

    Returns string

getTool

  • getTool(name: string): void
  • Get tool by specified name.

    Parameters

    • name: string

    Returns void

http

  • http(): HttpClient
  • Get built in http service for making http requests.

    Returns HttpClient

isDirty

  • isDirty(): any
  • 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

    Returns Promise<any>

newCanvas

  • newCanvas(width: number, height: number): Promise<object>
  • Parameters

    • width: number
    • height: number

    Returns Promise<object>

notify

  • notify(message: string, config?: ToastConfig): MatSnackBarRef<SimpleSnackBar>
  • Display specified notification message on the screen.

    Parameters

    Returns MatSnackBarRef<SimpleSnackBar>

on

  • on(event: string, callback: function): StaticCanvas
  • Listen to specified canvas event. (List of all available events can be found in the documentation)

    Parameters

    • event: string
    • callback: function
        • (e: IEvent): void
        • Parameters

          • e: IEvent

          Returns void

    Returns StaticCanvas

open

  • Open editor if it's currently closed. New configuration can also be optionally specified.

    Parameters

    Returns void

openEditorWithImage

  • openEditorWithImage(data: string | HTMLImageElement, asMainImage?: boolean): void
  • Open specified image and then editor.

    Parameters

    • data: string | HTMLImageElement
    • Default value asMainImage: boolean = true

    Returns void

openFile

  • openFile(data: string | HTMLImageElement, extension?: string, asMainImage?: boolean): Promise<void | Image>
  • Parameters

    • data: string | HTMLImageElement
    • Default value extension: string = "png"
    • Default value asMainImage: boolean = false

    Returns Promise<void | Image>

openMainImage

  • openMainImage(data: string | HTMLImageElement): void
  • Open specified photo as main canvas image.

    Parameters

    • data: string | HTMLImageElement

    Returns void

openPanel

  • Open specified editor panel. (Filter, crop, resize etc.)

    Parameters

    Returns void

resetAndOpenEditor

  • resetAndOpenEditor(key: string | PixieConfig, value?: any): Promise<void>
  • Fully reset and open editor.

    Parameters

    Returns Promise<void>

resetEditor

  • resetEditor(key: string | PixieConfig, value?: any): Promise<unknown>
  • Fully reset editor and canvas state and optionally override specified configuration.

    Parameters

    Returns Promise<unknown>

setConfig

  • setConfig(key: string | PixieConfig, value?: any): void
  • Override specified configuration. Accepts configuration object or key value pair using dot notation.

    Parameters

    Returns void