Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Drawing with masks
Drawing with masks [message #35372] |
Mon, 06 February 2012 19:47  |
lindquist
Messages: 33 Registered: March 2006 Location: Denmark
|
Member |
|
|
Quote: | Edit: I found Painter, so you can pretty much disregard my question below. I can use BeginMask to accomplish what I need, though it does seem somewhat overkill ... Painter does seem to be poorly documented. Anywhere I can find some pointer on getting decent performance from it? Thanks!
|
Hi.
I used U++ for a while, but it been some years since then. Now I'm back, but a bit rusty.
I'm writing an application that is - among other things - visualizing Gerber (RS-274X) files for PCB manufacturing. While a lot of the processing I'm doing happens on polygonizations, it's very convenient to use the regular Paint&Draw on my viewport widget.
Now some shapes in Gerber files can have a hole in them. Elipses, Rectandles, Obround (basically what a thick line in U++ looks like, with rounded ends) and regular polygons.
Each of these can have an optional round or rectangular hole in them. While this is easy to represent as a polygon with an inner shape defining the hole, it's very nice to just draw circles, rectangles and lines.
What I'm looking for is a nice way to mask out the portion containing the hole (as the hole is transparent) so I don't overdraw something underneath the hole.
I was thinking to have a separate image, same size as my viewport, then before I draw my circle, I draw the hole into this separate image, which is then used to mask the circle.
I've not been able to find something like this, but I figured I'd ask here before implementing something myself. Often I've found out that U++ already has something I've been looking for, but only after I've already implemented something myself.
If there is no such thing, I guess I will go with polygonizations for the times when there are holes. I'm also considering just using a GLCtrl, then it would be trivial. But I kinda like that people wont need OpenGL support in their system.
Can I avoid going for polygons ? Hope for a few ideas,
Best regards
[Updated on: Mon, 06 February 2012 23:59] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 18:39:21 CEST 2025
Total time taken to generate the page: 0.02951 seconds
|