How to learn graphical part of C++?

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2004
Posts: 2
Reputation: mishu1516 is an unknown quantity at this point 
Solved Threads: 0
mishu1516 mishu1516 is offline Offline
Newbie Poster

How to learn graphical part of C++?

 
1
  #1
Oct 9th, 2004
dear respected.......


would u plz help me to learn graphics in C++.Like drawing lines,circles,ellips etc.

Wish u all the best :mrgreen:
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,865
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 755
Team Colleague
Narue's Avatar
Narue Narue is online now Online
Senior Bitch

Re: How to learn graphical part of C++?

 
0
  #2
Oct 9th, 2004
>would u plz help me to learn graphics in C++
C++ doesn't support graphics natively. You need to choose a graphical library or API before someone can help you with it. A few good starters are Allegro, Qt, and SDL. A quick google search will give you reams of information on them.
New members chased away this month: 5
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 256
Reputation: FireNet will become famous soon enough FireNet will become famous soon enough 
Solved Threads: 6
FireNet's Avatar
FireNet FireNet is offline Offline
Posting Whiz in Training

Re: How to learn graphical part of C++?

 
1
  #3
Oct 10th, 2004
Look in the tutorial forum at dani too and google
See what you can, remember what you need

Fourzon | Earn via Coding
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,141
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 948
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: How to learn graphical part of C++?

 
0
  #4
Oct 10th, 2004
I know Narue will smile, but here I go again. There is a thing called BCX for free out there, that will translate rather simple basic like code to C, or with the $CPP directive to C++ code. A good way to at least study Win32 API calls.

To draw a red line from point (x=25,y=15) to point x=400,y=350) use the BCX basic code:
<code>BCX_LINE(Form1,25,15,400,350,Red)</code>This will translate to <code>#define Red RGB (255,0,0)
int BCX_Line (HWND,int,int,int,int,int=0,HDC=0);

int BCX_Line (HWND Wnd,int x1,int y1,int x2,int y2,int Pen,HDC DrawHDC)
{
int a,b=0;
HPEN hOPen;

HPEN hNPen=CreatePen(PS_SOLID,1,Pen);
if(!DrawHDC) DrawHDC=GetDC(Wnd),b=1;
hOPen=SelectObject(DrawHDC,hNPen);
MoveToEx(DrawHDC,x1,y1,NULL);
a = LineTo(DrawHDC,x2,y2);
DeleteObject(SelectObject(DrawHDC,hOPen));
if(b) ReleaseDC(Wnd,DrawHDC);
return a; // true or false
}
</code>which are mostly API calls.

Hope I did this code field stuff correctly!
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,141
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 948
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: How to learn graphical part of C++?

 
0
  #5
Oct 10th, 2004
Okay, I fugged up the code field thing, here it is again ...

I know Narue will smile, but here I go again. There is a thing called BCX for free out there, that will translate rather simple basic like code to C, or with the $CPP directive to C++ code. A good way to at least study Win32 API calls.

To draw a red line from point (x=25,y=15) to point x=400,y=350) use the BCX basic code:
  1. BCX_LINE(Form1,25,15,400,350,Red)
This will translate to
  1. #define Red RGB (255,0,0)
  2. int BCX_Line (HWND,int,int,int,int,int=0,HDC=0);
  3.  
  4. int BCX_Line (HWND Wnd,int x1,int y1,int x2,int y2,int Pen,HDC DrawHDC)
  5. {
  6. int a,b=0;
  7. HPEN hOPen;
  8.  
  9. HPEN hNPen=CreatePen(PS_SOLID,1,Pen);
  10. if(!DrawHDC) DrawHDC=GetDC(Wnd),b=1;
  11. hOPen=SelectObject(DrawHDC,hNPen);
  12. MoveToEx(DrawHDC,x1,y1,NULL);
  13. a = LineTo(DrawHDC,x2,y2);
  14. DeleteObject(SelectObject(DrawHDC,hOPen));
  15. if(b) ReleaseDC(Wnd,DrawHDC);
  16. return a; // true or false
  17. }
which are mostly API calls.

Hope I did this code field stuff correctly!
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 3182 | Replies: 4
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC