Well, I know that for this I need a graphic library but which one do you recommend?

I'm working on Windows, with VISUAL C++, and I know I can use windows libraries, or something, but there are a few problems with that (Mainly that I don't wanna use them).

Also, I would like to be able to port my project to Linux, once it's finished. Something that I see really hard, if I start using "windows.h".

This is the code I'm working on Right now:

#include <iostream>
#include <stdio.h>
#include "cv.h"
#include "highgui.h"

int _tmain(int argc, _TCHAR* argv[])
{

       /* data structure for the image */
       IplImage *img = 0;

	/* Create window */
    cvNamedWindow( "Imagen", CV_WINDOW_AUTOSIZE );

	/* Resize Window*/
	cvResizeWindow( "Imagen", /*widht/ancho= */ 700, /*height/largo= */ 500 );
	
       [B] /* Create a button?!? and when the button is pressed, load the image:
              img = cvLoadImage( ImgToLoad.jpg, CV_LOAD_IMAGE_COLOR ); */[/B]

	/* Wait for any key to be pressed */
	cvWaitKey(0);

          /* Destroy the window */
          cvDestroyWindow( "Imagen" );
          cvReleaseImage( &img );
	return 0;
}

If you run it, you'll see that it just creates an empty window, what I wanna do is to create a button, that when you press it, it shows the image. I know how to do that, I just need to know how to create the button.

P.D. BTW, I'm using the Opencv library
P.D.2 sorry for my terrible English, but I'm not american

Look at QT, it is a cross platform UI 'framework'

Well you can use Qt.

http://qt.nokia.com/products/

You can configure VS for Qt.

If it is just a single push button, i suggest you create a small rectangular box with a label on it that says "Press" or something like that. i mean would you like to use an entire framework/library for just a single button?

@theLamb
Oops, didn't see your reply.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.