cvCreateButton

Ask questions on using Emgu CV with C++
Post Reply
serino
Posts: 4
Joined: Thu Sep 15, 2011 6:24 am

cvCreateButton

Post by serino » Mon Sep 26, 2011 5:54 am

Code: Select all

#include<cv.h>
#include<highgui.h>

#include<iostream>
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"



using namespace cv;
using namespace std;


int main(int argc, char *argv[])
{

    int value = 50;
    int value2 = 0;

    cvNamedWindow("main1",CV_WINDOW_NORMAL);
    cvNamedWindow("main2",CV_WINDOW_AUTOSIZE | CV_GUI_NORMAL);

    cvCreateTrackbar( "track1", "main1", &value, 255,  NULL);//OK tested
    char* nameb1 = "button1";
    char* nameb2 = "button2";

[color=#FF0000]cvCreateButton(nameb2,callbackButton,nameb2,CV_CHECKBOX,0);[/color]


 //cvCreateButton(nameb1,nameb1,se,CV_CHECKBOX,1);


    //cvCreateButton(nameb2,callbackButton,nameb2,CV_CHECKBOX,0);
    cvCreateTrackbar( "track2", NULL, &value2, 255, NULL);
    //cvCreateButton("button5",callbackButton1,NULL,CV_RADIOBOX,0);
    //cvCreateButton("button6",callbackButton2,NULL,CV_RADIOBOX,1);

   // cvSetMouseCallback( "main2",on_mouse,NULL );

    IplImage* img1 = cvLoadImage("redr.jpg");
    //IplImage* img2 = cvCreateImage(cvGetSize(img1),8,3);
    //CvCapture* video = cvCaptureFromFile("1.avi");
    //IplImage* img3 = cvCreateImage(cvGetSize(cvQueryFrame(video)),8,3);

    while(cvWaitKey(33) != 27)
    {
        //cvAddS(img1,cvScalarAll(value),img2);
        //cvAddS(cvQueryFrame(video),cvScalarAll(value2),img3);
        //cvShowImage("main1",img2);
        //cvShowImage("main2",img3);
    }

    cvDestroyAllWindows();
    cvReleaseImage(&img1);
   // cvReleaseImage(&img2);
    //cvReleaseImage(&img3);
   // cvReleaseCapture(&video);
    return 0;
}
I can not make me run cvCreateButton,
how do I fix it?
I have problems with the definition of
callbackButton...

Post Reply