Re: [wx-users] How can I draw a rectangle with no border?

124 views
Skip to first unread message

Lionel Allorge

unread,
Jun 25, 2000, 12:22:56 PM6/25/00
to wx-u...@wxwindows.org
Hi,

> I can't find any method to let wxDC use a void pen.
> Anyone can help me? Thanks.

You use a transparent pen : wxTRANSPARENT_PEN
and a not transparent brush, for example : wxBLUE_BRUSH

For example to draw a blue rectangle with no border :

SetBrush(*wxBLUE_BRUSH);
SetPen(*wxTRANSPARENT_PEN);
DrawRectangle(x,y,x1,y1);

Lionel Allorge
E-mail : lionel....@lunerouge.com
Site : http://www.lunerouge.com


Hanhua Feng

unread,
Jun 25, 2000, 10:52:48 AM6/25/00
to wx-u...@wxwindows.org
I can't find any method to let wxDC use a void pen.
Anyone can help me? Thanks.
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

wxwin

unread,
Jun 26, 2000, 12:02:57 AM6/26/00
to wx-u...@wxwindows.org
----- Original Message -----
From: Hanhua Feng <abb...@hotmail.com>
To: <wx-u...@wxwindows.org>
Sent: 25 June 2000 21:52
Subject: [wx-users] How can I draw a rectangle with no border?


> I can't find any method to let wxDC use a void pen.
> Anyone can help me? Thanks.

use a "transparent" pen. One note of caution, previous versions would give
you a rectangle with a transparent border line, i.e. a rectangle that is one
linewidth (pixel?) smaller in each direction - I'm not sure if this got
changed in official version but we hacked our own copy to get full size
rectangles.

Regards

Dominic

Lionel Allorge

unread,
Jun 26, 2000, 8:47:30 AM6/26/00
to wx-u...@wxwindows.org
Hi,

> > I can't find any method to let wxDC use a void pen.
> > Anyone can help me? Thanks.
>
> use a "transparent" pen. One note of caution, previous versions would give
> you a rectangle with a transparent border line, i.e. a rectangle that is
one
> linewidth (pixel?) smaller in each direction - I'm not sure if this got
> changed in official version but we hacked our own copy to get full size
> rectangles.
> Regards
> Dominic

Well, the function is working ok for me. If you ask for a transparent pen,
it draw the line transparent !
Maybe we should create a real void pen with a size = 0.

Guillermo Rodriguez Garcia

unread,
Jul 3, 2000, 8:37:32 PM7/3/00
to wx-u...@wxwindows.org
At 10:53 26/06/00 +0100, you wrote:

> > I can't find any method to let wxDC use a void pen.
> > Anyone can help me? Thanks.
>
>use a "transparent" pen. One note of caution, previous versions would give
>you a rectangle with a transparent border line, i.e. a rectangle that is one
>linewidth (pixel?) smaller in each direction - I'm not sure if this got
>changed in official version but we hacked our own copy to get full size
>rectangles.

It got changed in the official version and now you get full size rectangles.

Regards,
G.
--
Guillermo Rodríguez García
<gui...@iies.es>

Reply all
Reply to author
Forward
0 new messages