1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
| #include <stdlib.h>
#include <string>
#include <sstream>
#include <iostream>
#include <fstream>
#include <float.h>
#include <stdio.h>
#include <iostream.h>
#include <FL/Fl_Gl_Window.H>
#include <FL/fl_box.H>
#include <FL/Fl_color_Chooser.H> // librairy correspondig to color chooser
#include <FL/gl.h>
#include <FL/Fl_Button.H>
#include <FL/Fl_Output.H>
#include <FL/Fl_Input.H>
#include <FL/Fl.H>// library for using FLTK
#include <FL/Fl_Window.H>// on add le prototype de la fenetre
#include <FL/Fl_Box.H>// aad library for this widget
#include <FL/fl_draw.H>
#include <FL/Fl_File_Chooser.H>
#include <FL/Fl_Bitmap.H>
#include <FL/Fl_BMP_Image.H>
#include "classwindow.h"
SoftWindow::SoftWindow(int x, int y,int w, int h, const char* title):Fl_Window(x,y,w,h,title)
{
begin();//sets the current group so you can build the widget tree by just constructing the widgets.
quit = new Fl_Button(550,550, 40, 30, "Quit");
quit->callback(cb_quit, this);
bild = new Fl_Box(80,80,300,300, "Datamatrix");
bild->box(FL_UP_BOX);
out = new Fl_Output(0, 400, 140, 200, "Outputwidth:");
datamatrix= new Fl_BMP_Image("C://Dev-Cpp//progavecacquisitionGUI//Bild//123456.bmp");//image taille 132*132
bild->image(datamatrix); //Affichage
const char* const* myarray;
myarray= datamatrix->data();
for(int i=0;i<132;i++)
for (int j=0;j<132;j++)
{
sprintf(charval,"%s(%d)",charval,(char)myarray[i][j]);
}
out->value(charval);
end();
show();
}
SoftWindow::~SoftWindow() //destructor
{}
void SoftWindow::cb_quit(Fl_Widget* , void* v)
{
( (SoftWindow*)v )-> hide();
}
int main ()
{
SoftWindow win(100,100,600,600,"SoftWindow");
win.hide();
win.show();
return Fl::run();
}
#ifndef CLasswindow_H
#define CLasswindow_H
class SoftWindow : public Fl_Window
{
public:
SoftWindow(int x, int y, int w, int h, const char* title );//constructor
~SoftWindow();//destructor
Fl_Button* quit;// button to quit the prog
//Fl_File_Chooser* look;
Fl_Output* out;
Fl_Box *matrix,*bild;
Fl_BMP_Image *datamatrix;
Fl_Image *buff;
private:
static void cb_quit(Fl_Widget*, void*);
};
#endif |
Partager