Sketch Plugin by Design+Code

Sketch Plugin by Design+Code

Author:Design+Code
Language: eng
Format: epub
Published: 2018-06-13T16:00:00+00:00


Image from Artboard

Let’s dive into getting image data from an artboard. First, set a computed variable for image data on the base Angle class:

get imageData ()

Then, we are going to set an immutable ancestry of the artboard. Then, we set an export format with 2x resolution and create an export request for the immutable layer and the format.

let layerAncestry = MSImmutableLayerAncestry.alloc().initWithMSLayer(this.artboard); let format = MSExportFormat.formatWithScale_name_fileFormat(2, "Angle", "png"); let request = MSExportRequest.exportRequestsFromLayerAncestry_exportFormats(layerAncestry, [format]).firstObject();

Finally, we ask for an exporter for the request and color space. And generate the output image by asking the exporter for its bitmap representation on TIFF.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.