Cut an inner region in a rectangle
-
Hello all,
I'm new in a developing with QML language and I'm stuck with a problem: I've 2 rectangles one inside another and I want the inner rectangle "cuts" the region it occupied from the outer rectangle. I need it because I'm using the outer rect as the border for the inner one, but inner color has an alpha channel part and as a result I have some undesirable color of the inner rect. Is there a way to accomplish the task?
I doesn't use a border property because it overlaps with a rect inner space.Thank in advance!
-
Let me see if I understood you correctly: you want to make a hole on the larger rectangle by adding a "transparent" on top of it?
Your best bet is to create 4 small rectangles (top,left,right,bottom) to create your border around the "central/inner" rectangle.
-
No, I don't wont to make holes :) But my inner rect is partly transparent and its color is blending with outer(border rect). I don't want any blending here.
It would be exactly what I need if there were bitwise operations on images\rectangles, but I found none.
fcrochik, your solution is obviously reasonable but it is rather the workaround. If there is no other way then I'll use it, but maybe there is? -
ixSci:
If your inner rectangle is transparent it has to blend to something. If you want to blend to the background (not the outer rectangle) than you actually "want" a hole on the outer rectangle so you can "see trough".
I don't think there is another way.
-
[quote author="ixSci" date="1292565051"]bitwise operations into QML?[/quote]
Could you give any more details about what you are looking for? Javascript (and thus QML) provides bitwise operators, but QML does not give access to raw pixel data for images, which might be what you are missing.With the QML scene graph project, the focus is shifting to GL shaders for graphical manipulation of items -- would something like that be helpful to you in this case?
Regards,
Michael -
[quote author="mbrasser" date="1292566775"]
With the QML scene graph project, the focus is shifting to GL shaders for graphical manipulation of items -- would something like that be helpful to you in this case?
[/quote]I'd like to see something like Rectangle{ overlapMode: intersect\unite\exclude etc.} but maybe I'm missing something. It happens very often when studying new technology but continue to keep in mind an older one.
Now I'm going to use a four-part border and when I have more thorough knowledge in QML perhaps I'll offer some suggestions