Status & Roadmap
Authors & License
Funding Ultimate++
Search on this site
Search in forums

SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Drawing with masks
Drawing with masks [message #35372] Mon, 06 February 2012 19:47 Go to next message
lindquist is currently offline  lindquist
Messages: 23
Registered: March 2006
Location: Copenhagen, Denmark
Promising Member

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!


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

Re: Drawing with masks [message #35373 is a reply to message #35372] Tue, 07 February 2012 04:38 Go to previous message
jerson is currently offline  jerson
Messages: 200
Registered: June 2010
Location: Bombay, India
Experienced Member

Will this help?

http://www.ultimatepp.org/examples$PainterExamples$en-us.htm l

or maybe this?
http://www.ultimatepp.org/forum/index.php?t=msg&goto=350 01&S=22df49a38eb988c188420d62c469006c&srch=starindic ator#msg_35001

[Updated on: Tue, 07 February 2012 04:40]

Report message to a moderator

Previous Topic: Static assertion
Next Topic: How to change the ZOrder of childcontrols at runtime?
Goto Forum:

Current Time: Wed May 27 11:26:47 CEST 2020

Total time taken to generate the page: 0.01537 seconds