Apache OpenOffice (AOO) Bugzilla – Issue 10589

Cutting bitmaps with Shape->Intersect

Last modified: 2003-09-08 16:52:24 UTC

When using the Shapes->Intersect function to cut out an area from a bitmap-image object, the resulting bitmap object is not correct (having been erroneously scaled during the cutting operation). N.B. Shapes->Subtract works OK.

Created attachment 4270 [details] illustration of Shape->Intersect operation problem

I've attached a image (exported from Draw) to illustrate this: On the left, theres a green-filled oval (an ellipse-object) above a red-&-white box (a bitmap object). The middle shows the result of using Shapes->Subtract on these: looks OK. On the right shows the result of using Shapes->Intersect: clearly the final bitmap does not correspond to the intersection of the box and green-oval.

Do you mean that the result has a wrong size ("erroneously scaled") or that the filling of the result is not correct? Thanks for your help.

Tricky to get this clear in words! I mean the final bitmap has the correct overall size (i.e. the outline of the sliced shape is correct), but the filling is wrong. Check the previously posted bitmap-mage for an illustration of this (and compare the red-and-white filling of the shapes).

Do you mean that the resulting shape part should also show just a part of the original filling from the rectangle? Just the lower section of the gradient?

Yes. I think that the resulting bitmap should just contain the section of the original bitmap enclosed by the 'intersection' of the two shapes (the lower part of the gradient, in this case). I assumed this was the intended behaviour. This would make the Subtract and Intersect operations symmetric such that the results of both operations would fit together to form the comlpete original image (i.e. in my example image the middle and right images should fit together like a jigsaw). *** I've just noticed that the final result from both Subtract and Intersect is a polygon-object, not a bitmap (where the original bitmap is used as a bitmap-fill for the final polygon). It seems my assumptions about how things *ought* to behave were wrong! In this case, my points are more of a feature-request than a defect-report. In summary: I think that that boolean operations (like Subtract and Intersect) when applied to bitmap & polygon should return a bitmap-object (with filling as I've described above). If this behavior is not desired, then the initial bitmap can be converted to a contour prior to the boolean operation, which would then return another polygon/contour. (sorry for using the terms 'polygon' and 'contour' interchangeably: I'm not sure which one is correct.)

I have talked to the responsible developer for this. Intersect and subtract are geometrical operations and not operations of the filling. Since always the fillstyle of the hindmost object is taken the result is correct. I am sorry but this works as wanted. Thank you for taking the time to post the issue. If you want some improvement on this functions feel free to write an enhancement wish.

Closed.