Import

Import tool allows importing of photos and pixie state files into the editor.
For example, you can open file upload dialog and then import selected image like so:

pixie.tools.import.openUploadDialog().then(function (obj) {
  var size = pixie.state.original;
  obj.set({ width: size.width, height: size.height, top: 0, left: 0 });
});

Methods

uploadAndAddImage

Open file upload window and add selected image to canvas.

uploadAndAddImage(): Promise<void>

uploadAndReplaceMainImage

Open file upload window and replace canvas contents with selected image.

uploadAndReplaceMainImage(): Promise<void>

uploadAndOpenStateFile

Open file upload window and replace canvas contents with selected state file.

uploadAndOpenStateFile(): Promise<void>

addImageFromUrl

Add image at specified url to canvas.

addImageFromUrl(url: string, select?: boolean): Promise<void>

addImageFromData

Add specified image data to canvas.

addImageFromData(data: string, select?: boolean): Promise<void>

loadState

Replace current editor state with specified one.

loadState(data: string | SerializedPixieState): Promise<void>

openBackgroundImage

Open specified data or image as background image.

openBackgroundImage(image: string | UploadedFile | HTMLImageElement): Promise<undefined | Image>