Hey guys,
I have a simple drawing app that creates an image. I am displaying the image just fine. When I try to share the image it also works, but a Base64 string is being shared instead of the image. Is there any way I can send the Image? Again… I am not using the Camera but creating the image in the app.
async share() {
await Share.share(
{
title: 'Whirly',
text: 'Check out my Whirly!',
url:this.imgSrc
}
)
}
I think that I am sending a Base64 string because that is exactly what the URL is pointing to. I don’t know a better way to do it.
Here is the code that is setting the URL
let imageData: string;
let data = this.context.getImageData(0, 0, this.canvasWidth, this.canvasHeight);
this.context.globalCompositeOperation = "destination-over";
this.context.fillStyle = this.backColor;
this.context.fillRect(0, 0, this.canvasWidth, this.canvasHeight);
imageData = this.canvas.toDataURL("image/png");
this.context.clearRect(0, 0, this.canvasWidth, this.canvasHeight);
this.context.putImageData(data, 0, 0);
this.context.globalCompositeOperation = 'source-over';
let picModal = await this.modalCtlr.create({
component: PicPage,
componentProps: {
"imgSrc": imageData
}
});
Thanks in advance