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 });
});
Open file upload window and add selected image to canvas.
uploadAndAddImage(): Promise<void>
Open file upload window and replace canvas contents with selected image.
uploadAndReplaceMainImage(): Promise<void>
Open file upload window and replace canvas contents with selected state file.
uploadAndOpenStateFile(): Promise<void>
Add image at specified url to canvas.
addImageFromUrl(url: string, select?: boolean): Promise<void>
Add specified image data to canvas.
addImageFromData(data: string, select?: boolean): Promise<void>
Replace current editor state with specified one.
loadState(data: string | SerializedPixieState): Promise<void>
Open specified data or image as background image.
openBackgroundImage(image: string | UploadedFile | HTMLImageElement): Promise<undefined | Image>