•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 426,892 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,362 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 2402 | Replies: 4
![]() |
>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.
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.
I'm a programmer. My attitude starts with arrogance, holds steady at condescension, and ends with hostility. Get used to it.
•
•
Join Date: Oct 2004
Location: Mojave Desert
Posts: 2,473
Reputation:
Rep Power: 10
Solved Threads: 176
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!
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!
•
•
Join Date: Oct 2004
Location: Mojave Desert
Posts: 2,473
Reputation:
Rep Power: 10
Solved Threads: 176
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:
This will translate to which are mostly API calls.
Hope I did this code field stuff correctly!
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:
BCX_LINE(Form1,25,15,400,350,Red)
#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
} Hope I did this code field stuff correctly!
May 'the Google' be with you!
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- own programming language? (Computer Science and Software Design)
- Almost time for college and... (Geeks' Lounge)
- Vectors, Functions, and Sorting... oh my! (C++)
- Im new (C++)
Other Threads in the C++ Forum
- Previous Thread: C++ for Dummies Programming Book
- Next Thread: Newbie - how do I start C++ programming?



and google
Linear Mode