Hi everyone.
I have a string in base64 and I have to convert it to NSImage.
I've tried and tried but I haven't found anything that solves my problem.
Can anyone help me? Thank you.
I insert part of the code here
This works but with a file path on the file system
let imageurl_nsurl = NSURL.alloc().initWithString(data.attrs.image.url);
let dataImage = NSImage.alloc().initByReferencingURL(imageurl_nsurl);
But here dataImage how do I value it?
`
let base64String = data.attrs.image.url;
let dataImage = NSImage ....;
options.style = new STYLE({
fills: [{
color: data.attrs.background,
fillType: STYLE.FillType.Pattern,
pattern:{
patternType: STYLE.PatternFillType.Fill, // Fill, Fit
image: dataImage
}
}],
borders: [{
color: lightenDarken(data.attrs.background, -0.3),
fillType: STYLE.FillType.Color,
position: STYLE.BorderPosition.Inside,
}],
})`