Groups | Blog | Home
all groups > dotnet compact framework > march 2008 >

dotnet compact framework : Control shape management problem


Lorenzo
3/23/2008 12:18:05 PM
Hi,
I want to draw 2 controls that have the shape of trapezium.
like these:

___________________
|\ /
| \ t2 /
| \ /
| \ ____________/
| t1 |
|___ |

The problem that i have is that after that i draw the first control
that contains
the first trapezium, the second one is not totally filled.
i think that the first control draw a rectangle, and the second one
can't fill the area that belong to the first one.

I draw the controls in their paint methods with fillpolygon method.

Here is my code:

Dim g As Graphics = Me.CreateGraphics()
Dim _brush As Brush
_brush = New SolidBrush(m_col)
g.FillPolygon(_brush, m_pts)
g.dispose()

How can i draw correctly the 2 controls?
Chris Tacke, eMVP
3/24/2008 10:56:09 AM
You likely need to set the clipping region for the shapes.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

[quoted text, click to view]

Lorenzo
3/26/2008 1:15:16 PM
I ' m agree with you, but i don't know how to build a region in CF.
There are 2 constructor for the region class.
The first without parameter and the second with a rectangle object.
I have in this case a polygon.
How can set the clipping region for this?

Thank you for your reply.



On 24 Mar, 16:56, "Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com>
[quoted text, click to view]
Paul G. Tobey [eMVP]
3/26/2008 1:27:37 PM
The last I remember, Windows CE didn't support regions that were anything
but rectangular. I think you may have to do your own clipping somehow or
adjust your expectations for what you need to do.

Paul T.

[quoted text, click to view]

Chris Tacke, eMVP
3/26/2008 3:34:14 PM
I'm fairly certain this is applicable:

http://www.opennetcf.org/permalink2.aspx?guid=f0abe92f-6e94-4a19-b0e3-11d1bdb3c9f0


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

[quoted text, click to view]

AddThis Social Bookmark Button