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 */

          /* 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

Well you can use Qt.


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?

Oops, didn't see your reply.

This article has been dead for over six months. Start a new discussion instead.