Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to setOverrideValue with local image path? #923

Open
miaopeng opened this issue May 30, 2024 · 0 comments
Open

How to setOverrideValue with local image path? #923

miaopeng opened this issue May 30, 2024 · 0 comments

Comments

@miaopeng
Copy link

miaopeng commented May 30, 2024

[Help Needed]
I wondering how to setOverrideValue with a local image file? This is my code but not working:

const nsImage = NSImage.alloc().initByReferencingFile(imagePath);
console.log('\t nsImage', nsImage);

const image = Image.fromNative(nsImage);

symbolInstance.setOverrideValue(override, image);

the console log:

override type Image
override property imageResizeBehavior
override editable true

	 nsImage <NSImage 0x600001da7840 Size={800, 600} RepProvider=<NSImageURLReferencingRepProvider:0x600002a1fd60 url:file:///....pathofmyfile/data/01.png reps:(
    "NSBitmapImageRep 0x60000048d490 Size={800, 600} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=800x600 Alpha=YES Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting) CGImageSource=0x600002c590c0"

Sketch Version: 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant