TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Ali Al-Roubaiai
from: Kurt Kuzba
date: 1998-07-05 06:48:26
subject: the line() functions

AA>   There are some commands in the windows.h file such as
AA>   LineADD, but in order to initialize them I would have to
AA>   learn how to use the whole windows graphics package which
AA>   seems like a whole different interface.
   All you need to do is use the Windows GDI and the API.
   Every window has a device context.
   You get that and then you call your basic API functions.
   There are things defined in windows.h which should be of
   interest to you. They deal with handling the API.
   A good book on using the Windows API would help you a lot.
   Here are a few of the GDI primitives. There are others, such
   as Arc(), Chord(), Pie(), DrawBezier(), Polygon() and
   PolyPolygon().
   Then there are such things as Pens and Brushes, which you
   will need to be able to define and select.
   I hope this is enough to get you started.
case WM_PAINT:
   // You need a handle to your window's device context
   HDC dc = GetDC(hwnd);
   // draws a line from 50,20 to 50,180
   // MoveTo(dc, hrz, vrt) Lineto(dc, hrz, vrt)
   MoveTo(dc,  20, 50);
   LineTo(dc, 180, 50);
   // draws a rectangle 1,1 - 200,100
   // Rectangle(dc, left, top, right, bottom)
   Rectangle(dc, 1, 1, 200, 100)
   // draws a rounded rectangle, 2,2 - 199,99
   // RoundRect(dc, left, top, right, bottom, hrzRound, vrtRound)
   // Rounding is more pronounced with larger rounding variables
   RoundRect(dc, 2, 2, 199, 99, 20, 20);
   // draws an elipse in a bounding box of 10,10 - 190,90
   // Ellipse(dc, left, top, right, bottom)
   Ellipse(dc, 10, 10, 190, 90)
   // You MUST release your HDC before exiting the function
   ReleaseDC(hwnd, dc);
   return 0;

> ] Redundancy: Playing "Battle of Evermore" during housework...

---
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
SEEN-BY: 396/1 622/419 632/371 633/260 267 270 371 634/397 635/506 728
SEEN-BY: 639/252 670/213 218
@PATH: 154/750 222 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.