コード例 #1
0
ファイル: MOUSE2.CPP プロジェクト: pjmodi/projects
void save(int x1, int y1, int x2, int y2)
{
unsigned area1,area2,area3,area4;

midx=x1+(x2-x1)/2;
midy=y1+(y2-y1)/2;

area1=imagesize(x1,y1,midx,midy);
(char)p1=(char)farmalloc(area1);
area2=imagesize(midx+1,y1,x2,midy);
(char)p2=(char)farmalloc(area2);
area3=imagesize(x1,midy+1,midx,y2);
(char)p3=(char)farmalloc(area3);
area4=imagesize(midx+1,midy+1,x2,y2);
(char)p4=(char)farmalloc(area4);

if(p1==NULL || p2==NULL || p3==NULL || p4==NULL)
	{
	closegraph();
	printf("Memory allocation error!");
	exit(2);
	}

getimage(x1,y1,midx,midy,p1);
getimage(midx+1,y1,x2,midy,p2);
getimage(x1,midy+1,midx,y2,p3);
getimage(midx+1,midy+1,x2,y2,p4);
}
コード例 #2
0
ファイル: mouse.c プロジェクト: cocoZhong/tetris_watcom
void buildMouseImage(void) {
	mouse.background = malloc(imagesize(0, 0, MOUSE_SIZE - 1, MOUSE_SIZE - 1));
	mouse.mask = malloc(imagesize(0, 0, MOUSE_SIZE - 1, MOUSE_SIZE - 1));
	mouse.img = malloc(imagesize(0, 0, MOUSE_SIZE - 1, MOUSE_SIZE - 1));
	mouse.mask->picwidth = mouse.mask->picheight = MOUSE_SIZE;
	mouse.img->picwidth = mouse.img->picheight = MOUSE_SIZE;
	mouse.mask->bpp = mouse.mask->bpp = mouse.background->bpp = SCREEN_BPP;
	expandMaskToImage(screenMask, &mouse.mask->buffer, __WHITE, MOUSE_SIZE, MOUSE_SIZE);
	expandMaskToImage(cursorMask, &mouse.img->buffer, __WHITE, MOUSE_SIZE, MOUSE_SIZE);
}
コード例 #3
0
ファイル: main.cpp プロジェクト: Betobit/Run-dino-run
void iniciaEntorno()
{
    int i;

    setfillstyle(1, COLOR(79, 182, 225));
    setbkcolor(COLOR(79, 182, 225));
    setcolor(WHITE);

    String nombres[NIMAGENES] = {
        "img/jungla.jpg",
        "img/jungla1.jpg",
        "img/jungla2.jpg",
        "img/jungla3.jpg",
        "img/jungla4.jpg",
        "img/jungla5.jpg",
        "img/creditos.jpg",
        "img/ayuda.jpg",
        "img/logotipo.gif"
    };

    // jungla
    for(i=0; i<6; i++)
    {
        bar(0,0,WIDTH,HEIGHT);
        readimagefile(nombres[i],0,0,WIDTH,300);
        imagenes[i]  = malloc(imagesize(0,0,WIDTH,300));
        getimage(0,0,WIDTH,300, imagenes[i]);
    }

    // Creditos
    bar(0,0,WIDTH,HEIGHT);
    readimagefile(nombres[i],0,0,1040,390);
    imagenes[i]  = malloc(imagesize(0,0,1040,390));
    getimage(0,0,1040,390, imagenes[i]);

    // Ayuda
    bar(0,0,WIDTH,HEIGHT);
    readimagefile(nombres[++i],0,0,1040,390);
    imagenes[i]  = malloc(imagesize(0,0,1040,390));
    getimage(0,0,1040,390, imagenes[i]);

    // logo
    bar(0,0,WIDTH,HEIGHT);
    readimagefile(nombres[++i],0,0,798,303);
    imagenes[i]  = malloc(imagesize(0,0,798,303));
    getimage(0,0,798,303, imagenes[i]);

    portada();
}
コード例 #4
0
ファイル: FED.C プロジェクト: MegaGod/TW
void draw_char( void ) {
	static int first = 1;
	int i, j;
	if ( load_first ) {
		first = 1;
		load_first = 0;
	}
	if ( !first ) {
		putimage( 0 + align, 0, matrix_image, COPY_PUT );
	} else {
		draw_grid( X, Y );
		matrix_image = ( char * ) realloc( matrix_image,
			imagesize( 0 + align, 0, ( WIDTH_X + 2 )*X + align, ( WIDTH_Y + 2 )*Y ) );
		getimage( 0 + align, 0, ( WIDTH_X + 2 )*X + align,
			( WIDTH_Y + 2 )*Y, matrix_image );
	}

	for ( j = 0; j < Y; j++ ) {
		for ( i = 0; i < X; i++ ) {
			if ( edit_font[i][j] ) {
				put_dot( i, j );
			} else if ( first ) {
				square( i, j );
			}
		}
	}
	first = 0;
}
コード例 #5
0
ファイル: MainFrame.cpp プロジェクト: BackupTheBerlios/qedo
MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
                 long style)
    : wxFrame((wxWindow *) NULL, -1, title, pos, size, style)
{
	hf = 0;
	// set icon
	SetIcon(wxIcon(qedoicon_xpm));
	

	
	panel_ = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize,
        wxTAB_TRAVERSAL | wxCLIP_CHILDREN | wxNO_BORDER );

	
    wxSize notebook_size(800,600);
    wxPoint notebook_point(5,5);

	hf=0;

	notebook_ = new ControllerNotebook(panel_, ID_NOTEBOOK, notebook_point, notebook_size);

	// create image list
	wxSize imagesize (32,32);
	wxImageList* notebook_image_list = new wxImageList(imagesize.GetWidth(), imagesize.GetHeight(), TRUE);

	notebook_image_list -> Add ( wxIcon(launcher_xpm));
	notebook_image_list -> Add ( wxIcon(qedoicon_xpm));

	notebook_ -> SetImageList(notebook_image_list);


	wxBoxSizer *hori_sizer = new wxBoxSizer(wxHORIZONTAL);
	wxBoxSizer *hori_sizer2 = new wxBoxSizer(wxVERTICAL);

	sizerFrame_ = new wxBoxSizer(wxHORIZONTAL);
	sizerFrame_->Add(hori_sizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5);
	sizerFrame_->Add(hori_sizer2, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5);

	panel_->SetSizer(sizerFrame_);

	notebook_ -> CreateControllerPages(hori_sizer);

	
	// set Logo
	wxBitmap qedologo_xpm( qedologo_xpm );
    wxStaticBitmap* qedo_logo = new wxStaticBitmap( panel_, wxID_STATIC, qedologo_xpm, wxDefaultPosition, wxSize(105, 31), 0 );
	hori_sizer2->Add(qedo_logo, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5);



	wxSize buttonsize(110,25);
	help = new wxButton(panel_, ID_HELP_BUTTON, _T("Help"),/*wxPoint(630,470) */ wxDefaultPosition,buttonsize,0);
	hori_sizer2->Add(help, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5);

	quit = new wxButton(panel_, ID_QUIT_CONTROLLER, _T("Close"), /* wxPoint(630,510)*/ wxDefaultPosition ,buttonsize,0);
	hori_sizer2->Add(quit, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5);

	panel_->SetAutoLayout(TRUE);
	
}
コード例 #6
0
ファイル: desenha.cpp プロジェクト: whateverton/tamagoshi
void importaMascara(imagem_type *imagem, const char* nome){
	int tamanho = 0;
	readimagefile(nome, 0, 0,imagem->largura, imagem->altura);
	tamanho = imagesize(0, 0,imagem->largura, imagem->altura);
	imagem->mask=  malloc(tamanho);
	getimage(0, 0, imagem->largura,imagem->altura,imagem->mask);
}
コード例 #7
0
ファイル: P405.CPP プロジェクト: agudeloandres/C_Struct_Files
int main() {
	int unidad = 0,modo,n;
	void *getmemoria(int),*p;

	initgraph (&unidad,&modo,"c:\\bc\\bgi");
	if (graphresult() != 0) {
		cout << "Error al tratar de pasar al modo grafico\n";
		getch();
		return 1;
	}
	n = imagesize (0,0,8,8);

	if (n == 0) {
		outtextxy (0,10,"n es cero");
		return 1;
	}
	if (graphresult() == -11) {
		outtextxy (0,20,"Error en imagesize() ");
		return 2;
	}
   outtextxy(0,0,"C");
	p = getmemoria (n);
	getimage (0,0,8,8,p);
	getch();
	setpalette (3,RED);
	setcolor (3);
	outtextxy(10,10,"C");
	getch();
	putimage (0,250,p,COPY_PUT);
	getch();
	closegraph();
	return 0;
}
コード例 #8
0
ファイル: GHOST_BU.CPP プロジェクト: vyshas/Ghost-Buster
 void bird(int a, int b)
 {
   if(z==0)
  {
   int lwing[]={40,20,60,20,20,60,40,20};
   int rwing[]={100,20,120,20,140,60,100,20};
   int face[]={60,20,60,10,70,15,90,15,100,10,100,20,80,40,60,20};
 setfillstyle(1,BLUE);
 fillpoly(4,lwing);
 fillpoly(4,rwing);
 fillpoly(8,face);
  unsigned int area=imagesize(20,1,140,60);
 buf= malloc(area);
 getimage(20,1,140,60,buf);
 delay(3000);
 z++;
  }
		if(kbhit())
	       {
		ch=getch();
		delay(100);
	       switch(ch)
	       {
		case 'a': if(x==60) ;
			   else   x-=160;
			  break;
		case 'd': if(x==540) ;
			   else  x+=160;
			  break;
	       }
	       }
 putimage(a,b,buf,XOR_PUT);
}
コード例 #9
0
/* IF USER JUST RUNS THE PROGRAM, WAIT  UNTIL 'ENTER'
   IS PRESSED TO FIND THE STARTING TIME */
void user_response(int x1,int y1,int col1,int col2)
{
	void* ext;
	unsigned int size; int line, choice;
	size = imagesize(x1,y1,x1+110,y1+50);	// calculate the size of the bar
	ext = malloc(size);			// allocate memory to hold the current image to use later
	getimage(x1,y1,x1+110,y1+50,ext);		// grab the image

	// WAIT  FOR USER RESPONSE
	for(line=0;;line++)
	{
		draw_3dbox(x1,y1,x1+110,y1+50,col1);
		settextstyle(2,0,5);
		color_text(260,135,"Press ENTER",col2);
		color_text(275,155,"to START",col2);

		delay(500);
		putimage(x1,y1,ext,COPY_PUT);         // blink
		delay(300);
		fflush(stdin);
		flushall();
		if(kbhit())
			choice=getch();
		if(choice==13)  //when Enter is pressed,lesson starts
			break;
	}

	free(ext);

}
コード例 #10
0
ファイル: 3-64.c プロジェクト: Huericiz/C_lg_small_examples
int main()
{
   int i,gd=DETECT,gm,size;
   void *buf;
   initgraph(&gd,&gm,"");
   setbkcolor(BLUE);
   cleardevice();
   setcolor(LIGHTRED);
   setlinestyle(0,0,1);
   setfillstyle(1,10);
   circle(100,200,30);
   floodfill(100,200,12);
   size=imagesize(69,169,131,231);
   buf=malloc(size);
   getimage(69,169,131,231,buf);
   putimage(500,269,buf,COPY_PUT);
   for(i=0;i<185;i++)
   {
      putimage(70+i,170,buf,COPY_PUT);
      putimage(500-i,170,buf,COPY_PUT);
   }
   for(i=0;i<185;i++)
   {
      putimage(255-i,170,buf,COPY_PUT);
      putimage(315+i,170,buf,COPY_PUT);
   }
   getch();
   closegraph();
}
コード例 #11
0
ファイル: P400.CPP プロジェクト: agudeloandres/C_Struct_Files
int main() {
	int unidad = 0,modo,n;
	char s[10];
	void *getmemoria(int),*p;

	initgraph (&unidad,&modo,"c:\\bc\\bgi");
	if (graphresult() != 0) {
		cout << "Error al tratar de pasar al modo grafico\n";
		getch();
		return 1;
	}
	n = imagesize (20,30,40,130);
	if (n == 0) {
		outtextxy (0,10,"n es cero");
		return 1;
	}
	if (graphresult() == -11) {
		outtextxy (0,20,"Error en imagesize() ");
		return 2;
	}
	itoa(n,s,10);
	outtextxy (0,0,"Numero de bytes: ");
	outtextxy (136,0,s);
	p = getmemoria (n);		// No esta dentro de las librerias del c++

	//   ... Procesos adicionales

	delete p;

	// Es obligatorio liberar la memoria asignada

	getch();
	closegraph();
	return 0;
}
コード例 #12
0
ファイル: FED.C プロジェクト: MegaGod/TW
void make_char_block_image( void ) {
	setcolor( 1 );
	moveto( 4 + align, 30 ); lineto( X + 3 + align, 30 ); lineto( X + 3 + align, Y + 29 );
	lineto( 4 + align, Y + 29 ); lineto( 4 + align, 30 );
	char_block_image = ( char* ) realloc( char_block_image,
		imagesize( 4 + align, 30, X + 3 + align, Y + 29 ) );
	getimage( 4 + align, 30, X + 3 + align, Y + 29, char_block_image );
	putimage( 4 + align, 30, char_block_image, XOR_PUT );
}
コード例 #13
0
ファイル: IMGSIZE.CPP プロジェクト: pjmodi/projects
int main(void)
{
clrscr();
   /* request autodetection */
   int gdriver = DETECT, gmode, errorcode;
   void *arrow;
   int x, y, maxx;
   unsigned int size;

   /* initialize graphics and local variables */
   initgraph(&gdriver, &gmode, "d:\\tc\\bgi");

   /* read result of initialization */
   errorcode = graphresult();
   if (errorcode != grOk)  /* an error occurred */
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");
      getch();
      exit(1); /* terminate with an error code */
   }

   maxx = getmaxx();
   x = 0;
   y = getmaxy() / 2;

   /* draw the image to be grabbed */
   draw_arrow(x, y);

   /* calculate the size of the image */
   size = imagesize(x, y-ARROW_SIZE, x+(4*ARROW_SIZE), y+ARROW_SIZE);

   /* allocate memory to hold the image */
   arrow = malloc(size);

   /* grab the image */
   getimage(x, y-ARROW_SIZE, x+(4*ARROW_SIZE), y+ARROW_SIZE, arrow);

   /* repeat until a key is pressed */
   while (!kbhit())
   {
      /* erase old image */
      putimage(x, y-ARROW_SIZE, arrow, XOR_PUT);

      x += ARROW_SIZE;
      if (x >= maxx)
          x = 0;

      /* plot new image */
      putimage(x, y-ARROW_SIZE, arrow, XOR_PUT);
   }

   /* clean up */
   free(arrow);
   closegraph();
   return 0;
}
コード例 #14
0
ファイル: desenha.cpp プロジェクト: whateverton/tamagoshi
void importaImagem(imagem_type *imagem, const char* nome){
	int tamanho = 0;
	readimagefile(nome, 0, 0,imagem->largura, imagem->altura);
	tamanho = imagesize(0, 0,imagem->largura, imagem->altura);
	imagem->img =  malloc(tamanho);
	getimage(0, 0, imagem->largura,imagem->altura,imagem->img);
	
	imagem->mask  = NULL;

}
コード例 #15
0
ファイル: snake.C プロジェクト: ramkicse/Snake-Game-in-C
ra()
{
	setcolor(14);
	settextstyle(0,0,1);
	outtextxy(250,5,"Welcome To SNAKE Game ");
	setfillstyle(1,15);
	bar(32,32,43,43);
	are=imagesize(30,30,45,45);
	f1=malloc(are);
	getimage(30,30,45,45,f1);
	putimage(30,30,f1,XOR_PUT);
	setfillstyle(1,4);
	bar(32,32,43,43);
	are=imagesize(30,30,45,45);
	f2=malloc(are);
	getimage(30,30,45,45,f2);
	putimage(30,30,f2,XOR_PUT);
 return 0;
}
コード例 #16
0
ファイル: orareader.cpp プロジェクト: hexaditidom/Drawpile
/**
 * If the load fails, you can get the (translateable) error message using \a error().
 * @return true on success
 */
bool Reader::load(const QString &filename)
{
	QFile orafile(filename);
	if(!orafile.open(QIODevice::ReadOnly)) {
		_error = orafile.errorString();
		return false;
	}

	ZipReader zip(&orafile);

	if(!zip.isReadable()) {
		_error = QApplication::tr("ORA file is unreadable!");
		return false;
	}

	// Make sure this is an OpenRaster file
	{
		QByteArray mimetype(zip.fileData("mimetype"));
		qDebug() << "read mimetype:" << mimetype;
		if(mimetype != "image/openraster") {
			_error = QApplication::tr("File is not an OpenRaster file");
			return false;
		}
	}

	// Read the stack
	QDomDocument doc;
	if(doc.setContent(zip.fileData("stack.xml"), true, &_error) == false)
		return false;

	const QDomElement stackroot = doc.documentElement().firstChildElement("stack");

	// Get the size of the image
	// These attributes are required by ORA standard.
	QSize imagesize(
			doc.documentElement().attribute("w").toInt(),
			doc.documentElement().attribute("h").toInt()
			);

	if(imagesize.isEmpty()) {
		_error = QApplication::tr("Image has zero size!");
		return false;
	}

	// Initialize the layer stack now that we know the size
	_commands.append(MessagePtr(new protocol::CanvasResize(imagesize.width(), imagesize.height())));

	_layerid = 0;
	_annotationid = 0;
	// Load the layer images
	if(loadLayers(zip, stackroot, QPoint()) == false)
		return false;

	return true;
}
コード例 #17
0
void* load_image( const char* _imgFileName, int _imgWidth, int _imgHeight )
{
    readimagefile( _imgFileName, 0, 0, _imgWidth, _imgHeight );

    unsigned int img_size = imagesize( 0, 0, _imgWidth, _imgHeight );

    void* p_temp_img = malloc( img_size );

    getimage( 0, 0, _imgWidth, _imgHeight, p_temp_img );

    return p_temp_img;
}
コード例 #18
0
ファイル: FED.C プロジェクト: MegaGod/TW
/*
malloc square_image, white_square_image, dot_image, init_clock
*/
void init_graph_and_cursor( void ) {
	int graphdriver, graphmode;
	extern void flush_clock( void );

	if ( scrmode == EGA || scrmode == EGA64 ) {
		graphdriver = EGA64;
		graphmode = EGA64HI;
	} else if ( scrmode == EGAMONO ) {
		graphdriver = EGAMONO;
		graphmode = EGAMONOHI;
	} else {
		graphdriver = HERCMONO;
		graphmode = HERCMONOHI;
	}
	initgraph( &graphdriver, &graphmode, "" );
	/*
	if (scrmode == EGAMONO) {
	esetgraph();
	} *//* use 2 plains only (TC use 4 plains) */
	setfillstyle( SOLID_FILL, WHITE );
	moveto( 0, 0 ); lineto( 2 + WIDTH_X, 0 ); lineto( WIDTH_X + 2, WIDTH_Y + 2 );
	lineto( 0, WIDTH_Y + 2 ); lineto( 0, 0 );
	square_image = ( char * ) malloc( imagesize( 0, 0, WIDTH_X + 2, WIDTH_Y + 2 ) );
	getimage( 0, 0, WIDTH_X + 2, WIDTH_Y + 2, square_image );
	floodfill( 1, 1, -1 );
	white_square_image = ( char * ) malloc( imagesize( 0, 0, WIDTH_X + 2, WIDTH_Y + 2 ) );
	getimage( 0, 0, WIDTH_X + 2, WIDTH_Y + 2, white_square_image );
	setcolor( 0 );
	moveto( 0, 0 ); lineto( 2 + WIDTH_X, 0 ); lineto( WIDTH_X + 2, WIDTH_Y + 2 );
	lineto( 0, WIDTH_Y + 2 ); lineto( 0, 0 );
	dot_image = ( char * ) malloc( imagesize( 0, 0, WIDTH_X + 2, WIDTH_Y + 2 ) );
	getimage( 0, 0, WIDTH_X + 2, WIDTH_Y + 2, dot_image );
	setcolor( 1 );
	clearviewport( );
	init_clock( );
	atexit( flush_clock );
}
コード例 #19
0
ファイル: GRAPHS.C プロジェクト: rickytan/Snooker
void getdat()									/*将鼠标和瞄准线点的图像保存*/
{
	int mx=0,my=0,size;
	int r=DOT_R;

	setcolor(15);
	setlinestyle(0,0,1);

	line(mx,my,mx+6,my+6);
	line(mx+7,my+7,mx+5,my+7);
	line(mx+4,my+8,mx+6,my+11);
	line(mx+5,my+11,mx+4,my+12);
	line(mx+3,my+11,mx+2,my+9);
	line(mx+1,my+9,mx,my+10);
	line(mx,my+9,mx,my+1);

	setfillstyle(SOLID_FILL,15);
	floodfill(mx+1,my+2,15);
	size=imagesize(0,0,8,12);
	mouse=malloc(size);
	mouse_temp=malloc(size);
	getimage(0,0,7,12,mouse);
	cleardevice();

	setcolor(WHITE);
	setlinestyle(0,0,1);

	circle(r,r,r);
	setfillstyle(SOLID_FILL,WHITE);
	floodfill(r,r,WHITE);

	size=imagesize(0,0,2*r,2*r);
	dash_dot=malloc(size);
	getimage(0,0,2*r,2*r,dash_dot);
	cleardevice();
}
コード例 #20
0
main()
{
   int gd = DETECT, gm, area, temp1, temp2, left = 25, top = 75;
   void *p;
 
   initgraph(&gd,&gm,"C:\\TC\\BGI");
 
   setcolor(YELLOW);
   circle(50,100,25);
   setfillstyle(SOLID_FILL,YELLOW);
   floodfill(50,100,YELLOW);
 
   setcolor(BLACK);
   setfillstyle(SOLID_FILL,BLACK);
   fillellipse(44,85,2,6);
   fillellipse(56,85,2,6);
 
   ellipse(50,100,205,335,20,9);
   ellipse(50,100,205,335,20,10);
   ellipse(50,100,205,335,20,11);
 
   area = imagesize(left, top, left + 50, top + 50);
   p = malloc(area);
 
   setcolor(WHITE);
   settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
   outtextxy(155,451,"Smiling Face Animation");
 
   setcolor(BLUE);
   rectangle(0,0,639,449);
 
   while(!kbhit())
   {
      temp1 = 1 + random ( 588 );
      temp2 = 1 + random ( 380 );
 
      getimage(left, top, left + 50, top + 50, p);
      putimage(left, top, p, XOR_PUT);
      putimage(temp1 , temp2, p, XOR_PUT);
      delay(100);
      left = temp1;
      top = temp2;
   }
 
   getch();
   closegraph();
   return 0;
}
コード例 #21
0
     savemenu(char **menu,char **buffer,int width, int count,int x1,int y1)
     {
       int i,x2,yy1,yy2,area,h;
       h=textheight(menu[0]);

       for(i=0;i<count;i++)
       {
	 x2=x1+width;
	 yy1=y1+i*(h+5);
	 yy2=y1+(i+1)*(h+5);

	 area=imagesize(x1,yy1,x2,yy2);
	 buffer[i]=malloc(area);
	 getimage(x1,yy1,x2,yy2,buffer[i]);
	}
	return 0;
     }
コード例 #22
0
MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
                 long style)
    : wxFrame((wxWindow *) NULL, -1, title, pos, size, style)
{
	hf = 0;
	// set icon
	SetIcon(wxIcon(qedoicon_xpm));

	panel_ = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize,
        wxTAB_TRAVERSAL | wxCLIP_CHILDREN | wxNO_BORDER);

    wxSize notebook_size(800,600);
    wxPoint notebook_point(5,5);

	 notebook_ = new ControllerNotebook(panel_, ID_NOTEBOOK, notebook_point, notebook_size);

	// create image list
	wxSize imagesize (32,32);
	wxImageList* notebook_image_list = new wxImageList(imagesize.GetWidth(), imagesize.GetHeight(), TRUE);

	notebook_image_list -> Add ( wxArtProvider::GetIcon(wxART_INFORMATION, wxART_OTHER, imagesize));

	notebook_ -> SetImageList(notebook_image_list);


	sizerFrame_ = new wxBoxSizer(wxBOTH);

	panel_->SetSizer(sizerFrame_);

	notebook_ -> CreateControllerPages(sizerFrame_);


	// set Logo
	wxBitmap qedologo_xpm( qedologo_xpm );
    wxStaticBitmap* qedo_logo = new wxStaticBitmap( panel_, wxID_STATIC, qedologo_xpm, wxPoint(605,20), wxSize(105, 31), 0 );


	wxSize buttonsize(110,25);
	help = new wxButton(panel_, ID_HELP_BUTTON, _T("Help"),wxPoint(630,470),buttonsize,0);
	quit = new wxButton(panel_, ID_QUIT_CONTROLLER, _T("Close"), wxPoint(630,510),buttonsize,0);

	panel_->SetAutoLayout(TRUE);

}
コード例 #23
0
ファイル: MAKEIMG.CPP プロジェクト: zzheads/SpectrumAnalyzer
void main(void)
{
int	gd=CGA, gm=CGAHI, errorcode, size;		//CGA графика с высоким разрешением
void far	*image;
FILE *file;

initgraph (&gd,&gm,"e:\\bc\\bgi\\");
errorcode = graphresult();

if (errorcode != grOk)  /* an error occurred */
	{
	 printf("Graphics error: %s\n", grapherrormsg(errorcode));
	 printf("Press any key to halt:");
	 getchar();
	 exit(-1);             /* return with error code */
	}

//setbkcolor (1);										// выбираем цвета
setcolor (BLACK);
																			// рисуем картинку
bar(0,0,100,100);
line(0,0,10,0);
line(1,1,7,1);
line(2,2,8,2);
line(3,3,5,3);
line(9,3,10,3);
line(4,4,4,4);
line(11,4,12,4);
//line(10,5,11,5);

getchar();
size = imagesize(0,0,12,4);
																			 // записываем ее в файл .img
image = farcalloc (1,size);
getimage(0,0,12,4,image);

file = fopen ("scur07.img","wb");
fwrite (image,size,1,file);
fclose(file);
farfree(image);

closegraph();
}
コード例 #24
0
void make_m_icon()
{
   cleardevice();
   //setcolor(15);
   int t[14];
   t[0]=0; t[1]=20;
   t[2]=30; t[3]=20;
   t[4]=30; t[5]=0;
   t[6]=40; t[7]=30;
   t[8]=30; t[9]=60;
   t[10]=30; t[11]=40;
   t[12]=0; t[13]=40;
   setfillstyle(1,10);
   fillpoly(7, t);
   msize = imagesize(0,0,40,60);
   micon = malloc(msize);
   getimage(0,0,40,60,micon);
   setcolor(15);
   cleardevice();
}
コード例 #25
0
Set_Bonus_Message()
{
  int size;
  int svcolor;
  int x,y;

  svcolor=getcolor();
  setcolor(TEXT_COLOR);
  x=MaxX/2 - 1.2*SMALL_HEXAGONE_SIZE_FACTOR*MaxX;
  y=MaxY/2 + 1.2*SMALL_HEXAGONE_SIZE_FACTOR*MaxX;
  gprintf(&x,&y,"Bonus");
  setcolor(svcolor); /* restore previous color */

  size=imagesize(0,0,40,9);        /*length of 5 characters*/
  buffer2=malloc(size);
  getimage(x,y,x+40,y+9,buffer2);
  putimage(x,y,buffer2,XOR_PUT);
  setcolor(svcolor);
  return(0);
}
コード例 #26
0
Set_Bonus_Chars()
{
  int size,i,j;
  int x,y;

	/* set character Size */
  size=imagesize(0,0,16,16);
	/* get right location */
  x=MaxX/2 - 1.2*SMALL_HEXAGONE_SIZE_FACTOR*MaxX;
  y=MaxY/2 + 1.2*SMALL_HEXAGONE_SIZE_FACTOR*MaxX;

 for (i=0;i<10;i++)
     {
	  bc[i]=malloc(size);
	  Display_Bonus_Char(Bonus_Char_Vector[i][0]);
	  getimage(x,y,x+16,y+16,bc[i]);
	  putimage(x,y,bc[i],XOR_PUT);
     }
 return(0);
}
コード例 #27
0
ファイル: teris.c プロジェクト: yyh1102/teris
void delete_last(int bottom)
{
	int i,j,time=0;
	struct picture *p;
	p = (struct picture *)malloc(imagesize(X0,Y0,X0+320-2,Y0+(bottom)*STEP-1));
	if(p)
	{
		getimage(X0,Y0,X0+320-2,Y0+(bottom)*STEP-1,p);
		setfillstyle(SOLID_FILL,DARKGRAY);
		bar(X0,Y0,X0+320-1,Y0+STEP);
		putimage(X0,Y0+STEP,p,COPY_PUT);
	}
	for (i=bottom; i>0 ;i-- )
	{
		for (j=0; j<10 ;j++ )
		{
			map_check[j][i] = map_check[j][i-1];
		}
	}
}
コード例 #28
0
ファイル: GFXFORM3.C プロジェクト: krattai/flosh
void putlogo(void)
{
	/* this function display the uvea logo on the screen */

	unsigned size;
	void far *ptr[3];
	FILE *fptr;
	int color;
	int x,y,count;

	/* logo based on these dimensions: 105,0,565,465 */
	size=imagesize(105,0,565,(465+1)/3);
	fptr=fopen("LOGO3.PIC","rb");
	restore_screen(fptr,size);
	fclose(fptr);

	/* wait */
	sleep(2);

    removelogo();
}
コード例 #29
0
ファイル: P566.CPP プロジェクト: agudeloandres/C_Struct_Files
void Ventana::DibujarVentana() {
	int i;
	mouse.Esconder();
	if (Buffer != 0) {
		i = imagesize (X, Y, X1, Y1);
		if (i == -1)  // Asi debe ser y no como en el programa de la
							// pagina 565. Favor corregir sobre el texto.
			Error("Imagen muy grande para almacenar");
		Copia = new int [i];
		if (Copia == NULL)
			Error("Memoria Insuficiente");
		getimage (X, Y, X1, Y1, Copia);
	}
	setcolor (WHITE);
	rectangle (X, Y, X1, Y1);
	setfillstyle (SOLID_FILL, LIGHTGRAY);
	bar (X+1, Y+1, X1-1, Y1-1);
	if (TieneBorde != 0) {
		// Implemente aqui el Tipo de Borde deseado
	}
	mouse.Mostrar();
}
コード例 #30
0
ファイル: 3-72.c プロジェクト: Huericiz/C_lg_small_examples
void DrawPlan(void)
{
  int size;
  setcolor(LIGHTRED);
  setfillstyle(1,BLUE);
  ellipse(x0,y0-height,0,180,width1,3*width1);
  moveto(x0+width1,y0);
  lineto(x0+width1,y0-height);
  moveto(x0+width1,y0);
  lineto(x0+width2,y0+y2);
  moveto(x0-width1,y0);
  lineto(x0-width1,y0-height);
  moveto(x0-width1,y0);
  lineto(x0-width2,y0+y2);
  moveto(x0+width2,y0+y3);
  lineto(x0+width2,y0+y1);
  moveto(x0+width2,y0+y3);
  lineto(x0+width1,y0+y2);
   moveto(x0-width2,y0+y3);
  lineto(x0-width2,y0+y1);
   moveto(x0-width2,y0+y3);
  lineto(x0-width1,y0+y2);
   moveto(x0,y0+y4);
  lineto(x0+width1,y0+y2);
   moveto(x0,y0+y4);
  lineto(x0-width1,y0+y2);
  setfillstyle(2,LIGHTRED);
  floodfill(x0,y0,LIGHTRED);
  size=imagesize(x0-width2-1,y0-height-3*width1,x0+width2+1,y0+y4);
  buf=malloc(size);
  if(!buf)
  {
    printf("NO enough memory!");
    exit(0);
  }
  getimage(x0-width2,y0-height-3*width1,x0+width2,y0+y4,buf);
}