🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.sys.palmtops.pilot
Article #253

Re: C++ src for drawing graphics

#253
From: Mark
Date: Fri, 03 Aug 2001 17:56
46 lines
2335 bytes
The Palm API includes functions for drawing rectangles, lines, & pixels.
Here's some code for circle drawing (modified Bresenham algorithm).

void DrawCircle( int xc, int yc, int r)
{
 int x = 0;
 int y = r;
 int p = 3 - 2 * r;

 while (x <= y)
 {
  WinDrawPixel(xc + x, yc + y);
  WinDrawPixel(xc - x, yc + y);

  WinDrawPixel(xc + x, yc - y);
  WinDrawPixel(xc - x, yc - y);

  WinDrawPixel(xc + y, yc + x);
  WinDrawPixel(xc - y, yc + x);

  WinDrawPixel(xc + y, yc - x);
  WinDrawPixel(xc - y, yc - x);

  if (p < 0)
   p += 4 * x++ + 6;
  else
   p += 4 * (x++ - y--) + 10;
 }
 }

"Kevin Wittmer" <kwittmer@sprintmail.com> wrote in message
news:Kf877.11747$Xn.1411793@newsread1.prod.itd.earthlink.net...
> Hello,
>
> Please reply back to this new postings if you know a good source on the
web
> for sample C++ CodeWarrior/Palm source code projects that demonstrate how
to
> draw simple graphics such as lines and circles on a Palm PDA.
>
> Thanks in advance,
>
>    Kevin
>
>
>
Technical Details
Message-ID: <7BBa7.20401$Ke4.11726990@news1.sttln1.wa.home.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshub2.home.com!news.home.com!news1.sttln1.wa.home.com.POSTED!not-for-mail
References: <Kf877.11747$Xn.1411793@newsread1.prod.itd.earthlink.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109e18,63348144951e7904
X-Google-Attributes: gid109e18,public
X-Google-Thread: 10baa0,63348144951e7904
X-Google-Attributes: gid10baa0,public
X-Google-Thread: 11219a,63348144951e7904
X-Google-Attributes: gid11219a,public
X-Google-ArrivalTime: 2001-08-03 10:56:20 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshub2.home.com!news.home.com!news1.sttln1.wa.home.com.POSTED!not-for-mail
From: "Mark" <mark@zframe.comNOSPAM>
Newsgroups: alt.comp.sys.palmtops.pilot,codewarrior.palm,comp.sys.palmtops
References: <Kf877.11747$Xn.1411793@newsread1.prod.itd.earthlink.net>
Subject: Re: C++ src for drawing graphics
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Message-ID: <7BBa7.20401$Ke4.11726990@news1.sttln1.wa.home.com>
Date: Fri, 03 Aug 2001 17:56:19 GMT
NNTP-Posting-Host: 65.3.174.118
X-Complaints-To: abuse@home.net
X-Trace: news1.sttln1.wa.home.com 996861379 65.3.174.118 (Fri, 03 Aug 2001 10:56:19 PDT)
NNTP-Posting-Date: Fri, 03 Aug 2001 10:56:19 PDT
Organization: Excite@Home - The Leader in Broadband http://home.com/faster