⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tab.h

📁 一个TAB页
💻 H
字号:
#ifndef tabs_h#define tabs_h#include <FL/Fl.H>#include <FL/Fl_Window.H>#include <FL/fl_draw.H>#include <FL/Fl_Tabs.H>#include <FL/Fl_Group.H>#include <FL/Fl_Input.H>#include <FL/Fl_Button.H>#include <FL/Fl_Select_Browser.H>#include <FL/Fl_Return_Button.H>#include <FL/Fl_Light_Button.H>#include <FL/Fl_Check_Button.H>#include <FL/Fl_Round_Button.H>//#include <FL/Fl_Box.H>//#include <FL/Fl_Clock.H>#include <stdlib.h>#include <stdio.h>#include <string.h>#include <FL/Fl_Image.H>//fuction//int search_pos(int *a,int c,int n){/////////////	for(int i=1;i<n;i++)		if(a[i]==c)return i;	return 0;	}char *str_cat(char *ch,char c){//////
	int m;int i;
	char *cc;
	m=strlen(ch);
	cc=(char *)malloc(sizeof(char)*(m+1));
	for(i=0;i<m;i++)cc[i]=ch[i];
	cc[m]=c;
	return cc;
}//jpegextern "C" {#include "jpeglib.h"}struct jpeg{	int width;	int height;	int depth;	int linedelta;	uchar* ibuffer;}jpeg;struct jpeg* readtheimage(const char *name) {  struct jpeg_decompress_struct cinfo;  struct jpeg_error_mgr jerr;  struct jpeg* jp;  FILE * infile = fopen(name, "rb");  if (!infile) {    fprintf(stderr, "can't open %s\n", name);    exit(1);  }  cinfo.err = jpeg_std_error(&jerr);  jpeg_create_decompress(&cinfo);  jpeg_stdio_src(&cinfo, infile);  jpeg_read_header(&cinfo, TRUE);  jpeg_start_decompress(&cinfo);  jp->width = cinfo.output_width;  jp->height = cinfo.output_height;  jp->depth = cinfo.output_components;  uchar *ibuffer = new uchar[(jp->width)*(jp->height)*(jp->depth)];  uchar *rp = ibuffer;  for (int i=0; i<(jp->height); i++) {    jpeg_read_scanlines(&cinfo, &rp, 1);    rp += (jp->width)*(jp->depth);  }  jp->ibuffer=ibuffer;  jpeg_finish_decompress(&cinfo);  jpeg_destroy_decompress(&cinfo);  fclose(infile);  return jp;}//class image_window : public Fl_Window {  struct jpeg jpg;  void draw();public:  image_window(struct jpeg* jp) : Fl_Window(jp->width,jp->height) {  	box(FL_NO_BOX);  	color(FL_BLUE);  	jpg.width=jp->width;  	jpg.height=jp->height;  	jpg.depth=jp->depth;  	jpg.ibuffer=jp->ibuffer;  	}};void image_window::draw() {    fl_draw_image(jpg.ibuffer,0,0,jpg.width,jpg.height,jpg.depth,jpg.linedelta);}uchar* make_image(int width1,int height1) {  uchar* image = new uchar[3*width1*height1];  uchar *p = image;  for (int y = 0; y < height1; y++) {    double Y = double(y)/(height1-1);    for (int x = 0; x < width1; x++) {      double X = double(x)/(width1-1);      *p++ = uchar(255*((1-X)*(1-Y))); // red in upper-left      *p++ = uchar(255*((1-X)*Y));	// green in lower-left      *p++ = uchar(255*(X*Y));	// blue in lower-right    }  }  return image;}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -