C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 16th, 2002, 03:20 PM
suhailkaleem suhailkaleem is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 9 suhailkaleem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
how to make a star and quater moon ?

hi !

how can i make star with five corners on pixels and a half moon ?

thanks

Reply With Quote
  #2  
Old August 16th, 2002, 05:00 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 42 m 50 sec
Reputation Power: 184
a half moon is a circle with one half cut off, no? and a quarter moon is a big circle with a smaller circle cut off.

a five corner star (or any star) is created using polygons.

your questions should go to "graphics" and not here... if you want an answer how to do it in C, tell us your OS. there is no OS-independent graphics

for windows this would be something similar to:
Code:
HRGN rgn, rgn2;
dc=getDc(.... where you want to paint to);
rgn=createellipticrgn(0,0,100,100);
rgn2=createellipticrgn(10,10,100,100);
combinergn(rgn,rgn,rgn2,DIFF_RGN);
fillpolyrgn(dc,rgn);
deleteobject(rgn);
deleteobject(rgn2);
releasedc(..see above..., dc);

for the moon and
Code:
POINT **pts;
HRGN rgn;
*pts[0]=POINT(50,0);
*pts[1]=POINT(0,30);
... fill the other points here ...
dc=.... (see above)
rgn=createpolyrgn(pts,sizeof(pts),WINDING);
fillpoly(dc,rgn);
deleteobject(rgn);
releasedc(..., dc);

for the star: if you want a pentagram, you need to calculate the points using sin() and cos() functions for getting exact 360/5=72 degree slices of a circle. (this answer should go to "algorithms")

graphics programming is a lot of mathematics, you should get a good book on vectors, matrices and that stuff...

greetings,
M

ps. the reason i can tell this just from my head right now is that i had to do this stuff at work over the last 5 weeks
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > how to make a star and quater moon ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway