Issue 10589 - Cutting bitmaps with Shape->Intersect
Summary: Cutting bitmaps with Shape->Intersect
Alias: None
Product: Draw
Classification: Application
Component: code (show other issues)
Version: OOo 1.0.1
Hardware: PC Linux, all
: P2 Trivial (vote)
Target Milestone: ---
Assignee: wolframgarten
QA Contact: issues@graphics
Depends on:
Reported: 2003-01-10 18:23 UTC by bryancole
Modified: 2003-09-08 16:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

illustration of Shape->Intersect operation problem (18.81 KB, image/png)
2003-01-10 18:25 UTC, bryancole
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description bryancole 2003-01-10 18:23:34 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.
Comment 1 bryancole 2003-01-10 18:25:16 UTC
Created attachment 4270 [details]
illustration of Shape->Intersect operation problem
Comment 2 bryancole 2003-01-10 18:25:50 UTC
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.
Comment 3 wolframgarten 2003-01-13 08:17:43 UTC
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.
Comment 4 bryancole 2003-01-13 10:10:16 UTC
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).
Comment 5 wolframgarten 2003-01-13 10:28:21 UTC
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?
Comment 6 bryancole 2003-01-13 11:07:48 UTC
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

(sorry for using the terms 'polygon' and 'contour' interchangeably:
I'm not sure which one is correct.)
Comment 7 wolframgarten 2003-01-13 13:30:12 UTC
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.
Comment 8 wolframgarten 2003-01-13 13:30:34 UTC