Drawing a circle

Drawing a circle

Post by Jake » Thu, 26 Jun 2003 11:51:45

Hi all,

How does one draw a circle in a GroupBox?
When I draw a circle it appears only on the Form.



Drawing a circle

Post by Team » Sat, 28 Jun 2003 11:42:55


Quote:> How does one draw a circle in a GroupBox?
> When I draw a circle it appears only on the Form.

You need to access the device context (DC) of the GroupBox, e.g., via the
GetDC() Win32 function.  The TControlCanvas VCL class encapsulates this
process; here's an example...

#include <memory>
void __fastcall TForm1::Button2Click(TObject *Sender)
    ControlCanvas(new TControlCanvas());
  ControlCanvas->Control = GroupBox1;
  ControlCanvas->Ellipse(0, 0, 100, 100);


If you need the drawing to be persistent (i.e., the circle should remain
visible whenever the GroupBox is visible), you'll need to render in response
to the GroupBox's WM_PAINT message.  The easy VCL-oriented way to do this is
to drop a TPaintBox control onto the GroupBox, and then place your
circle-drawing code within the PaintBox's OnPaint event handler.

Good luck,
Damon (TeamB)
BCBCAQ - http://bcbcaq.bytamin-c.com


1. How to draw a circle with the PostScript curveto operator

The subject says it all.
How do I draw a circle with the PS curveto operator ?
This is the way Adobe Illustrator draws circles, but when I try do do it
the same way, I obtain circles which seem slightly distorted.


Jean Thioulouse - Laboratoire de Biometrie - Universite Lyon 1
69622 Villeurbanne CEDEX - France        Fax: (33) 78 89 27 19

2. *.cgm...Any programs which will display?

3. Draw a circle in x86 asm

4. PSP Tutorial books

5. Wanted: Fastest way to draw a circle.

6. A qustion of Netiquette

7. How can I draw a circle?

8. programs for Win 3.11

9. Drawing a circle

10. Bitmap mode, drawing a circle or elipse

11. Drawing a circle outline ?

12. how to draw a circle ??