Post

Replies

Boosts

Views

Activity

Reply to ImageRenderer on iOS - generates blurry image, .scale ineffective?
Running into the same issue on my end— @gchiste When sharing the Data directly through ShareLink, it seems to share a binary file that doesn't automatically get interpreted as an image by the system. Amusingly, I did find that taking the Data returned from .pngData() and passing it to a new UIImage, then passing that to an Image view and sharing through ShareLink does preserve the size 🎉 However it also seems to lose the alpha channel, so kind of a mixed bag. let renderer = ImageRenderer(content:helloWorldView()) renderer.scale = UIScreen.main.scale renderer.scale = 3.0 if let image = renderer.uiImage,     let data = image.pngData(), let fullImage = UIImage(data: data) {           ShareLink(item: Image(uiImage: fullImage),                 preview: SharePreview("", image: Image(uiImage: fullImage))) { /* etc */ } }
Oct ’22