Interactive Ink

Answered

How to differentiate between image and drawing

I am using addImage() method to add image from camera/gallery and using addBlock(point.x, point.y, "Drawing") method to embed drawing. I want to differentiate between image and drawing. However contentBlock.getType() returning Drawing in both cases. How do differentiate


Best Answer

Hello Dipannita,


Thank you for your question.


The addImage indeed adds the image in a drawing block and there is no difference between "Drawing" blocks containing drawing and the ones used to add an image.


As the addImage method returns you the "Drawing" block associated with the newly added image, you might then store and use the id of this image Drawing block for further use.


Best regards,


Gwenaëlle



1 Comment

Answer

Hello Dipannita,


Thank you for your question.


The addImage indeed adds the image in a drawing block and there is no difference between "Drawing" blocks containing drawing and the ones used to add an image.


As the addImage method returns you the "Drawing" block associated with the newly added image, you might then store and use the id of this image Drawing block for further use.


Best regards,


Gwenaëlle