Graphics

Hi! I am sort of a beginner in C++. I am in the middle of Functions (I) of this documentation. I just wanted to know how do you create graphics in C++ in Visual Studio. I use 2012 RC.
You ask the operating system to do it for you, via the provided API.

www.winprog.org/tutorial/

Alternatively, use a widget toolkit; you ask the widget toolkit, the widget toolkit asks the OS.

en.wikipedia.org/wiki/List_of_widget_toolkits
No, I mean I need some source code.
I could copy and paste the source code from www.winprog.org/tutorial/ here for you, but I'd rather tell you to go there to read it.

Do you just want to create a graphic, or do you want to show it on screen as well?
Last edited on
I just want to show it on screen.
Here is how to use the CImg library to show an image on screen:

1
2
3
4
5
6
7
8
9
10
11
#include "CImg.h"
#include <iostream>
using namespace cimg_library;

int main()
{
  
  CImg<unsigned char> image("someImage.jpg");
  CImgDisplay main_disp(image);
  std::cin.ignore();
}
Hey Shahmeer.

I think you want to do GUI creation ? Right ?
Then here two question arise actually.

1) In C++ so are you planning it cross platform ?
For crossplatform GUI creation best options are

Juce(preffered) - http://www.rawmaterialsoftware.com/juce.php/
Qt(Most used) - http://qt.nokia.com/products/
WxWidget - http://www.wxwidgets.org/

2) in C++ and already you doing in VS, but for which OS ?
window 8
http://code.msdn.microsoft.com/windowsapps
or windowOld(7,vista,xp)
MFC and ATL window GUI creation APIs

I know there are lots GUI creation APIs available for C++, But i have tried to keep it low and best used in industries. Hope it will help you.
Topic archived. No new replies allowed.