Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to begin graphics NEED HELP.... or at least send me the syntax to create graphics...
I want to create my graphics of my name at the end of my program of c++
it is created on VS 2013 and i am using window 10... may be this would help you answer my question
THANK You! <3

What I have tried:

C++
#include<graphics>
#include<dos.h>
#include<window>
#include<stdlib.h>
#include<conio.h>
using namespace std;

int main()
{
	initwindow(900, 900);
	setcolor(RED);
	settextstyle(3, 0, 6);
	outtextxy(10, 10, "PROGRAMMING FUNDAMENTALS");
	settextstyle(5, 0, 2);
	outtextxy(150, 80, "SECTIONR");
	settextstyle(8, 0, 2);
	outtextxy(250, 80, " SECTIONO");
	//For line 1, Input : x1 = 150, y1 = 150, x2 = 450, y2 = 150
	setcolor(YELLOW);
	line(150, 150, 450, 150);
	//For line 2, Input : x1 = 150, y1 = 200, x2 = 450, y2 = 200
	setcolor(BLUE);
	line(150, 200, 450, 200);
	setcolor(GREEN);
	line(150, 250, 450, 250);
	//For line 2, Input : x1 = 150, y1 = 250, x2 = 450, y2 = 250

	getch();
	closegraph();
	return 0;
}
Posted
Updated 5-Jul-20 22:37pm
v4
Comments
Rick York 5-Jul-20 17:12pm    
What kind of graphics? 2D, 3D?
NaumanMalik 6-Jul-20 1:53am    
I want to create my graphics of my name at the end of my program of c++
it is created on VS 2013 and i am using window 10... may be this would help you answer my question
Richard MacCutchan 6-Jul-20 3:01am    
Those libraries are so old as to be totally obsolete. Follow CPallini's advice and use the proper graphics features of Windows.
NaumanMalik 6-Jul-20 4:37am    
okay on it
RedDk 6-Jul-20 0:24am    
DOS.H ... on no known computer after year 2000 will any 16-bit program run. "Run" in the general sense of the word.

When you use Visual Studio you may use C# or C++. When you use C++ use may use the "old granny" MFC. Here is some basic drwaing tutorial. You need to learn some basic before you can move on.

You really should evaluate WHAT you want to accomplish and than rethink the tools. Some UI is better developed with C# and its controalss today even drawing some stuff isnt more complex than in C++. IMHO C++ is the tool of choice if you want to learn or have some massive codebase for it.
 
Share this answer
 
Comments
Maciej Los 7-Jul-20 5:32am    
5ed!
You could try to rewrite your program for using GDI+. Have a look at Getting started with GDI+ - Win32 apps | Microsoft Docs[^]
 
Share this answer
 
Comments
Patrice T 6-Jul-20 3:34am    
My 5
CPallini 6-Jul-20 4:45am    
Thank you.
NaumanMalik 6-Jul-20 4:35am    
okay i am going to try that
Maciej Los 7-Jul-20 5:32am    
5ed!
CPallini 7-Jul-20 13:36pm    
Thank you again, Maciej!
Quote:
Graphics, how to write a graphics program on visual studio

First of all graphics are not linked to VS.
Graphics depend on a few things:
- OS: Windows, Linux, DOS, WebApp
- Compiler/Language
- Framework
- 2D or 3D
There is tens of possibilities, each with its own way to do graphics.
The only sensible thing to do is Google for your combination and look for tutorials and/or read manuals.
 
Share this answer
 
Comments
NaumanMalik 6-Jul-20 1:53am    
I want to create my graphics of my name at the end of my program of c++
it is created on VS 2013 and i am using window 10... may be this would help you answer my question
Patrice T 6-Jul-20 3:36am    
Advice: follow Solution 4
CPallini 6-Jul-20 4:46am    
5.
Patrice T 6-Jul-20 4:54am    
Thank you
NaumanMalik 6-Jul-20 4:56am    
Welcome by the way i am new so i am sorry for not rating comments
If you want to run that code in-particular, you'll need Borland Turbo-C (this will not run on Windows)
 
Share this answer
 
Comments
NaumanMalik 6-Jul-20 1:54am    
but i want to add graphics at the end of my code of c++ program on VS 2013 running on OS: Window 10
CPallini 6-Jul-20 4:46am    
5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900