Relative Content

Tag Archive for fabricjshtml2canvas

get the left most and right most x and y on a canvas that have some design on them (not transparent)

Given a canvas, id like to find only the points that have some design on them, seem to have it working except that the bounding rectangle of the image is also calculated as not being transparent even though there is actually no design on. For example in the image below the leftx=0, even though the actual left most pixelshould be where the actual rainbow design starts. It calculates using that putline box around the image that appears when clicking on the image. This is an issue for images that have a lot of transparent space around the. i tried using canvas.discardActiveObject() thinking it wouldnt calculate if the item is deselected but still get same issue. in the second image i show image without the selection rectangle.