您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GrSetGCForeground函数代码示例

51自学网 2021-06-01 21:19:27
  C++
这篇教程C++ GrSetGCForeground函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GrSetGCForeground函数的典型用法代码示例。如果您正苦于以下问题:C++ GrSetGCForeground函数的具体用法?C++ GrSetGCForeground怎么用?C++ GrSetGCForeground使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GrSetGCForeground函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: menu_draw_scrollbar

/* draws the scrollbar; calculates it and all */void menu_draw_scrollbar(menu_st *menulist){	int per = menulist->screen_items * 100 / menulist->num_items;	int height = (menulist->h - 2) * (per < 3 ? 3 : per) / 100;	int y_top = ((((menulist->h - 3) - height) * 100) * menulist->sel /			(menulist->num_items - 1)) / 100 + menulist->y + 1;	int y_bottom = y_top + height;	/* only draw if appropriate */	if(menulist->screen_items >= menulist->num_items)		return;	/* draw the containing box */	GrSetGCForeground(menulist->menu_gc,				appearance_get_color( CS_SCRLBDR ));	GrRect(menulist->menu_wid, menulist->menu_gc, menulist->w - 8,			menulist->y, 8, menulist->h - 1);	/* erase the scrollbar */	GrSetGCForeground(menulist->menu_gc,				appearance_get_color( CS_SCRLCTNR ));	GrFillRect(menulist->menu_wid, menulist->menu_gc, menulist->w - (8 - 1),			menulist->y + 1, (8 - 2), y_top - (menulist->y + 1));	GrFillRect(menulist->menu_wid, menulist->menu_gc, menulist->w - (8 - 1),			y_bottom, (8 - 2), (menulist->h - 3) - y_bottom);	/* draw the bar */	GrSetGCForeground(menulist->menu_gc,				appearance_get_color( CS_SCRLKNOB ));	GrFillRect(menulist->menu_wid, menulist->menu_gc, menulist->w -			(8 - 1), y_top, (8 - 2), height);	/* restore the fg */	GrSetGCForeground(menulist->menu_gc, BLACK);}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:36,


示例2: kmbitmap

static void kmbitmap(void){		GrSetGCUseBackground(keyman_gc, GR_FALSE); 	GrSetGCForeground(keyman_gc, BLACK); 	switch(wnow.shupict){		case 0:GrBitmap(mainmenu_pixmap, keyman_gc, wnow.XLOC,(wnow.YLOC-(wnow.MAPSCROLL % 16)), 16, 16, keymap1_black);break;		case 1:GrBitmap(mainmenu_pixmap, keyman_gc, wnow.XLOC,(wnow.YLOC-(wnow.MAPSCROLL % 16)), 16, 16, keymap2_black);break;		case 2:GrBitmap(mainmenu_pixmap, keyman_gc, wnow.XLOC,(wnow.YLOC-(wnow.MAPSCROLL % 16)), 16, 16, keymap3_black);break;	}	GrSetGCForeground(keyman_gc, GRAY); 	switch(wnow.shupict){		case 0:GrBitmap(mainmenu_pixmap, keyman_gc, wnow.XLOC,(wnow.YLOC-(wnow.MAPSCROLL % 16)), 16, 16, keymap1_gray);break;		case 1:GrBitmap(mainmenu_pixmap, keyman_gc, wnow.XLOC,(wnow.YLOC-(wnow.MAPSCROLL % 16)), 16, 16, keymap2_gray);break;		case 2:GrBitmap(mainmenu_pixmap, keyman_gc, wnow.XLOC,(wnow.YLOC-(wnow.MAPSCROLL % 16)), 16, 16, keymap3_gray);break;	} 	GrSetGCForeground(keyman_gc, LTGRAY); 	switch(wnow.shupict){		case 0:GrBitmap(mainmenu_pixmap, keyman_gc, wnow.XLOC,(wnow.YLOC-(wnow.MAPSCROLL % 16)), 16, 16, keymap1_ltgray);break;		case 1:GrBitmap(mainmenu_pixmap, keyman_gc, wnow.XLOC,(wnow.YLOC-(wnow.MAPSCROLL % 16)), 16, 16, keymap2_ltgray);break;		case 2:GrBitmap(mainmenu_pixmap, keyman_gc, wnow.XLOC,(wnow.YLOC-(wnow.MAPSCROLL % 16)), 16, 16, keymap3_ltgray);break;	}	GrSetGCForeground(keyman_gc, WHITE); 	switch(wnow.shupict){		case 0:GrBitmap(mainmenu_pixmap, keyman_gc, wnow.XLOC,(wnow.YLOC-(wnow.MAPSCROLL % 16)), 16, 16, keymap1_white);break;		case 1:GrBitmap(mainmenu_pixmap, keyman_gc, wnow.XLOC,(wnow.YLOC-(wnow.MAPSCROLL % 16)), 16, 16, keymap2_white);break;		case 2:GrBitmap(mainmenu_pixmap, keyman_gc, wnow.XLOC,(wnow.YLOC-(wnow.MAPSCROLL % 16)), 16, 16, keymap3_white);break;	}}
开发者ID:iPodLinux-Community,项目名称:Floydzilla,代码行数:29,


示例3: draw_rook

/* Draw the rook */void draw_rook(int coord_x, int coord_y, int color){	GR_POINT rook[] = {		{coord_x+1, coord_y+1}, {coord_x+3, coord_y+1},		{coord_x+3, coord_y+3}, {coord_x+5, coord_y+3},		{coord_x+5, coord_y+1}, {coord_x+7, coord_y+1},		{coord_x+7, coord_y+3}, {coord_x+9, coord_y+3},		{coord_x+9, coord_y+1}, {coord_x+11, coord_y+1}, 		{coord_x+11, coord_y+4}, {coord_x+9, coord_y+4},		{coord_x+9, coord_y+8}, {coord_x+11, coord_y+8},		{coord_x+11, coord_y+11}, {coord_x+1, coord_y+11}, 		{coord_x+1, coord_y+8}, {coord_x+3, coord_y+8}, 		{coord_x+3, coord_y+4}, {coord_x+1, coord_y+4},		{coord_x+1, coord_y+1}	};	if(color == 0)	{		GrSetGCForeground(tuxchess_gc,WHITE);		GrFillPoly(tuxchess_wid,tuxchess_gc,21,rook);		GrSetGCForeground(tuxchess_gc,BLACK);		GrPoly(tuxchess_wid,tuxchess_gc,21,rook);	}	else	{		GrSetGCForeground(tuxchess_gc,BLACK);		GrFillPoly(tuxchess_wid,tuxchess_gc,21,rook);	}}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:30,


示例4: periodic_draw_element

void periodic_draw_element(GR_WINDOW_ID wid, GR_GC_ID gc, int i, int bx, int by, int cellsize){	int ex = (bx+((periodic_elements[i].group-1)*cellsize));	int ey = (by+((periodic_elements[i].period-1)*cellsize));	int tx, ty;	char tt[4];	if (i == periodic_sel) {		GrSetGCForeground(gc, GR_RGB(0,0,0));		GrFillRect(wid, gc, ex, ey, cellsize+1, cellsize+1);		GrSetGCForeground(gc, GR_RGB(255,255,255));	} else {		if (screen_info.bpp < 8) {			GrSetGCForeground(gc, periodic_color_palette_bw[periodic_elements[i].color]);		} else {			GrSetGCForeground(gc, periodic_color_palette[periodic_elements[i].color]);		}		GrFillRect(wid, gc, ex, ey, cellsize+1, cellsize+1);		GrSetGCForeground(gc, GR_RGB(0,0,0));		GrRect(wid, gc, ex, ey, cellsize+1, cellsize+1);	}	if (cellsize >= 8) {		strcpy(tt, periodic_elements[i].symbol);		if (strlen(tt) > 2) {			tt[1] = tt[strlen(tt)-1];			tt[2] = 0;			tx = ex + cellsize/2 - 4;		} else if (tt[1] != 0) {			tx = ex + cellsize/2 - 4;		} else {			tx = ex + cellsize/2 - 2;		}		ty = ey + cellsize/2 - 4;		periodic_tinyfont_draw_string(wid, gc, tx, ty, tt);	}}
开发者ID:Keripo,项目名称:ProjectZeroSlackr-SVN,代码行数:35,


示例5: draw_rook

/* Draw the rook */void draw_rook(int coord_x, int coord_y, char color){	GR_POINT rook[] = {		{coord_x+1, coord_y+1}, {coord_x+3, coord_y+1},		{coord_x+3, coord_y+3}, {coord_x+5, coord_y+3},		{coord_x+5, coord_y+1}, {coord_x+7, coord_y+1},		{coord_x+7, coord_y+3}, {coord_x+9, coord_y+3},		{coord_x+9, coord_y+1}, {coord_x+11, coord_y+1}, 		{coord_x+11, coord_y+4}, {coord_x+9, coord_y+4},		{coord_x+9, coord_y+8}, {coord_x+11, coord_y+8},		{coord_x+11, coord_y+11}, {coord_x+1, coord_y+11}, 		{coord_x+1, coord_y+8}, {coord_x+3, coord_y+8}, 		{coord_x+3, coord_y+4}, {coord_x+1, coord_y+4},		{coord_x+1, coord_y+1}	};	if(color == 'w')	{		GrSetGCForeground(tuxchess_gc,GR_RGB(255,255,255));		GrFillPoly(tuxchess_wid,tuxchess_gc,21,rook);		GrSetGCForeground(tuxchess_gc,GR_RGB(0,0,0));		GrPoly(tuxchess_wid,tuxchess_gc,21,rook);	}	else	{		GrSetGCForeground(tuxchess_gc,GR_RGB(0,0,0));		GrFillPoly(tuxchess_wid,tuxchess_gc,21,rook);	}}
开发者ID:iPodLinux-Community,项目名称:ZacZilla,代码行数:30,


示例6: create_status

// create the circular status animationstatic void create_status() {	int i;	int xpie[] = {  0,  3, 6,  3, 0, -3, -6, -3 }; 	int ypie[] = { -6, -3, 0,  3, 6,  3,  0, -3 }; 	// we need 16 frames	GrSetGCForeground (mandel_gc, appearance_get_color( CS_TITLEBG ));	for (i=0;i<16;i++) {		status_image[i] = GrNewPixmap(12, 12,  NULL);		GrFillRect(status_image[i],mandel_gc,0,0,12,12);		}		// the background	for (i=1;i<8;i++) {		GrSetGCForeground(mandel_gc, appearance_get_color(CS_TITLEFG));		GrFillEllipse(status_image[i],mandel_gc,6,6,6,6);		GrSetGCForeground(mandel_gc, appearance_get_color(CS_TITLEBG));		GrArc(status_image[i],mandel_gc,6,6,6,6,0,-6,xpie[i],ypie[i],MWPIE);	}	// the foreground part	GrSetGCForeground(mandel_gc, appearance_get_color(CS_TITLEFG));	GrFillEllipse(status_image[8],mandel_gc,6,6,6,6);	for (i=9;i<16;i++) GrArc(status_image[i],mandel_gc,6,6,6,6,0,-6,xpie[i-8],ypie[i-8],MWPIE);}
开发者ID:Keripo,项目名称:ProjectZeroSlackr-SVN,代码行数:27,


示例7: saver4_animate

void saver4_animate(nstate *state){	int i, tail, newtip;	s4state *s = state->priv;	if(s->length == SAVER4_WORMLENGTH) tail = s->tip + 1;	else tail = 0;	if(tail == SAVER4_WORMLENGTH) tail = 0;	newtip = s->tip + 1;	if(newtip == SAVER4_WORMLENGTH) newtip = 0;		for(i = 0; i < SAVER4_NUMWORMS; i++) {		GrSetGCForeground(state->main_gc, GR_COLOR_BLACK);		GrFillRect(state->main_window, state->main_gc,					s->worms[i].points[tail].x,					s->worms[i].points[tail].y,					SAVER4_WORMTHICKNESS,					SAVER4_WORMTHICKNESS);		saver4_get_new_worm_position(state, i, newtip);		GrSetGCForeground(state->main_gc, s->worms[i].colour);		GrFillRect(state->main_window, state->main_gc,					s->worms[i].points[newtip].x,					s->worms[i].points[newtip].y,					SAVER4_WORMTHICKNESS,					SAVER4_WORMTHICKNESS);	}	s->tip = newtip;	if(s->length < SAVER4_WORMLENGTH) s->length++;}
开发者ID:ghaerr,项目名称:microwindows,代码行数:30,


示例8: draw_set

voiddraw_set(char *name, int mode){	int x;	int tw, th, tb;	GR_POINT points[4];	GR_GC_ID gc = GrNewGC();	GrSetGCForeground(gc, WHITE);	GrSetGCBackground(gc, GRAY);	GrGetGCTextSize(gc, name, -1, GR_TFTOP, &tw, &th, &tb);	x = g_x + (tw - 50) / 2;	GrText(g_main, gc, g_x, 5, name, -1, GR_TFTOP);	g_x += (tw + 10);	GrSetGCFillMode(gc, mode);	if (mode == GR_FILL_STIPPLE)		GrSetGCForeground(gc, YELLOW);	else {		GrSetGCForeground(gc, WHITE);		GrSetGCBackground(gc, BLUE);	}	if (mode == GR_FILL_TILE) {		GrSetGCTile(gc, g_pixmap, 16, 16);	}	if (mode == GR_FILL_STIPPLE || mode == GR_FILL_OPAQUE_STIPPLE)		GrSetGCStipple(gc, g_stipple2, 2, 2);	GrFillRect(g_main, gc, x, 25, 50, 50);	if (mode == GR_FILL_STIPPLE || mode == GR_FILL_OPAQUE_STIPPLE)		GrSetGCStipple(gc, g_stipple1, 7, 7);	GrFillEllipse(g_main, gc, x + 25, 105, 25, 25);	if (mode == GR_FILL_STIPPLE || mode == GR_FILL_OPAQUE_STIPPLE)		GrSetGCStipple(gc, g_stipple3, 3, 2);	points[0].x = points[3].x = x;	points[0].y = points[3].y = 165;	points[1].x = x + 50;	points[1].y = 165;	points[2].x = x + 25;	points[2].y = 215;	GrFillPoly(g_main, gc, 4, points);	GrDestroyGC(gc);}
开发者ID:BadrElh,项目名称:microwindows,代码行数:58,


示例9: draw_bar

static void draw_bar(int bar_length){	if (!(bar_length < 0 || bar_length > rect_x2-rect_x1-4) ) {		GrFillRect (mp3_wid, mp3_gc, rect_x1 + 2, rect_y1+2, bar_length, rect_y2-rect_y1-4);		GrSetGCForeground(mp3_gc, GR_RGB(255,255,255));		GrFillRect(mp3_wid, mp3_gc, rect_x1 + 2 + bar_length, rect_y1+2, rect_x2-rect_x1-4 - bar_length, rect_y2-rect_y1-4);		GrSetGCForeground(mp3_gc, GR_RGB(0,0,0));	}}
开发者ID:Keripo,项目名称:ProjectZeroSlackr-SVN,代码行数:9,


示例10: video_draw_pause

static void video_draw_pause(){	GrSetGCForeground(video_gc, GR_RGB(255,255,255));	GrFillRect(video_wid, video_gc, 8, 8, 16, 32);	GrFillRect(video_wid, video_gc, 32, 8, 16, 32);	GrSetGCForeground(video_gc, GR_RGB(0,0,0));	GrRect(video_wid, video_gc, 8, 8, 16, 32);	GrRect(video_wid, video_gc, 32, 8, 16, 32);}
开发者ID:Keripo,项目名称:ProjectZeroSlackr-SVN,代码行数:9,


示例11: idw_draw_sheet

static void idw_draw_sheet(TSheet *sheet) {  GR_SIZE width, height, base;  char str[50], *ap;  int i;		if (sheet == NULL) {    sheet = game.screen->menuitems[game.select].sheet;  }		// draw the title  pz_draw_header (sheet->title);  GrGetGCTextSize(idw_gc, sheet->button, -1, GR_TFASCII, &width, &height, &base);  height+=4;      // (left, top, right, bottom)  GrSetGCForeground(idw_gc, BLACK);  GrLine(idw_wid, idw_gc, 20, 0, 20, screen_info.rows-44);  GrLine(idw_wid, idw_gc, 20, screen_info.rows-44, screen_info.cols-20, screen_info.rows-44);  GrLine(idw_wid, idw_gc, screen_info.cols-20, 0, screen_info.cols-20, screen_info.rows-44);  	GrSetGCForeground(idw_gc, WHITE);  GrFillRect(idw_wid, idw_gc, 21, 0, screen_info.cols-41, screen_info.rows-44);	GrSetGCForeground(idw_gc, BLACK);  GrSetGCUseBackground(idw_gc, GR_FALSE);  GrSetGCMode(idw_gc, GR_MODE_SET);    ap = strtok(sheet->text, "/n");  for (i=0; ap != NULL; i++) {    GrText(idw_wid, idw_gc, 30, 1 + ((i + 1) * height - 4), ap, -1, GR_TFASCII);    ap = strtok(NULL, "/n");  }  	if (sheet->ammount != -1)	{    // print ammount    sprintf(str, "Ammount: %d", game.ammount);    GrText(idw_wid, idw_gc, 30, 50, str, -1, GR_TFASCII);  } else {    // the next time the user presses the middle button the sheet will disappear    game.dismiss_sheet = 1;  }  // print the single menu option  GrSetGCForeground(idw_gc, BLACK);  GrFillRect(idw_wid, idw_gc, 21, 1 + 4 * height-4, screen_info.cols-41, height-1);  GrSetGCForeground(idw_gc, WHITE);  GrSetGCUseBackground(idw_gc, GR_TRUE);  GrText(idw_wid, idw_gc, (screen_info.cols/2)-width+4, (5 * height - 8), sheet->button, -1, GR_TFASCII);  // we're in a transaction  game.in_transaction = 1;  }
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:54,


示例12: menu_clear_pixmap

/* clears specified pixmap, (GrClearWindow doesnt work properly for a pixmap) */void menu_clear_pixmap(menu_st *menulist, int pos){	if(pos < 0 || pos > menulist->screen_items - 1) {		Dprintf("menu_clear_pixmap::No Such Pixmap/n");		return;	}	GrSetGCForeground(menulist->menu_gc, appearance_get_color( CS_BG ));	GrFillRect(menulist->pixmaps[menulist->pixmap_pos[pos]],			menulist->menu_gc, 0, 0, 440, menulist->height);	GrSetGCForeground(menulist->menu_gc, appearance_get_color( CS_FG ));}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:12,


示例13: draw_ball

static void draw_ball(int col,int row,int ibmp,int icolor){    if(ipodc == 0 ){	GrBitmap(ipobble_wid, ipobble_gc, col, row, BALL_WIDTH - 1,		 BALL_WIDTH - 1, balls_bmp[ibmp]);    } else {        if (icolor!=-1)GrSetGCForeground(ipobble_gc, BallColors[icolor]);	GrBitmap(ipobble_wid, ipobble_gc, col, row, BALL_WIDTH - 1,		 BALL_WIDTH - 1, balls_bmp[ibmp]);    }    if(icolor!=-1)GrSetGCForeground(ipobble_gc, BLACK);}
开发者ID:iPodLinux-Community,项目名称:podzillaz,代码行数:12,


示例14: draw_king

/* Draw the king */void draw_king(int coord_x, int coord_y, char color){	GrSetGCForeground(tuxchess_gc,GR_RGB(0,0,0));	GrLine(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+1,coord_x+6,coord_y+4);	GrLine(tuxchess_wid,tuxchess_gc,coord_x+4,coord_y+2,coord_x+8,coord_y+2);	if(color == 'w')		GrSetGCForeground(tuxchess_gc,GR_RGB(255,255,255));	GrFillEllipse(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+8,4,4);	GrSetGCForeground(tuxchess_gc,GR_RGB(0,0,0));	GrEllipse(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+8,4,4);}
开发者ID:iPodLinux-Community,项目名称:ZacZilla,代码行数:13,


示例15: menu_draw

/* does the drawing, safe(and recommended) to use {in, as} an exposure event */void menu_draw(menu_st *menulist){	int i;	/* appearance changed, force a redraw */	if(menulist->scheme_no != appearance_get_color_scheme() ||			get_current_font() != menulist->font) {		menu_update_menu(menulist);	}	/* first draw; init onscreen text items */	if(menulist->init == 0) {		for(i = (menulist->num_items > menulist->screen_items) ?				menulist->screen_items : menulist->num_items;				i; i--)			menu_retext_pixmap(menulist, i - 1,				&menulist->items[menulist->top_item + (i - 1)]);		menulist->init = 1;	}#if 0	else if(menulist->lastsel == menulist->sel) {		Dprintf("Aborted draw because %d == %d/n", menulist->sel,				menulist->lastsel);		return;	}	Dprintf("Continuing, %d != %d/n", menulist->sel, menulist->lastsel);#endif	/* draw each pixmap */	for(i = 0; i < menulist->screen_items; i++)		menu_draw_item(menulist, i);	/* erase the bottom unused part of the allocated screen */	GrSetGCForeground(menulist->menu_gc, appearance_get_color( CS_BG ));	GrFillRect(menulist->menu_wid, menulist->menu_gc, menulist->x,			menulist->height * menulist->screen_items, menulist->w,			menulist->h - (menulist->height *			menulist->screen_items));	GrSetGCForeground(menulist->menu_gc, BLACK);	/* draw scrollbar if needed */	if(menulist->num_items > menulist->screen_items) {		menulist->scrollbar = 1;		menu_draw_scrollbar(menulist);	}	else		menulist->scrollbar = 0;	/* deal with the timer */	menu_handle_timer(menulist, 0);	menulist->lastsel = menulist->sel;}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:54,


示例16: draw_king

/* Draw the king */void draw_king(int coord_x, int coord_y, int color){ 	GrSetGCForeground(tuxchess_gc,BLACK);	GrLine(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+1,coord_x+6,coord_y+4);	GrLine(tuxchess_wid,tuxchess_gc,coord_x+4,coord_y+2,coord_x+8,coord_y+2);	if(color == 0)		GrSetGCForeground(tuxchess_gc,WHITE);	GrFillEllipse(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+8,4,4);	GrSetGCForeground(tuxchess_gc,BLACK);	GrEllipse(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+8,4,4);}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:13,


示例17: video_draw_searchbar

static void video_draw_searchbar(){	int height = .1 * video_screenHeight;	int offX;        offX = (int)((double)((double)video_curPosition/mainHeader.dwTotalFrames) * (video_screenWidth-30)) + 16;	GrSetGCForeground(video_gc, GR_RGB(255,255,255));	GrFillRect(video_wid, video_gc, 16, video_screenHeight-2 * height, video_screenWidth-30+6, height);	GrSetGCForeground(video_gc, GR_RGB(0,0,0));	GrRect(video_wid, video_gc, 16, video_screenHeight-2 * height, video_screenWidth-30+6, height);	GrFillRect(video_wid, video_gc, offX, video_screenHeight-2*height, 5, height);}
开发者ID:Keripo,项目名称:ProjectZeroSlackr-SVN,代码行数:13,


示例18: menu_flash_selected

/* flash selected item. ala apple fw */void menu_flash_selected(menu_st * menulist){	int item;	item = menulist->sel - menulist->top_item;	GrSetGCForeground(menulist->menu_gc, WHITE);	GrFillRect(menulist->menu_wid, menulist->menu_gc, menulist->x,			menulist->y + item * menulist->height,			menulist->w - (menulist->scrollbar ? 8 : 0),			menulist->height);	GrSetGCForeground(menulist->menu_gc, BLACK);	menulist->items[menulist->sel].op |= CFLASH;	menu_handle_timer(menulist, 0);}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:14,


示例19: gprintf

/* ***********************************************************/static void gprintf(char s[]){	static char lasttext[128];        GrSetGCForeground(text_gc,BLACK);        GrFillRect(text, text_gc, 0, 0, 394,20);        GrSetGCForeground(text_gc,WHITE);        GrSetGCBackground(text_gc,BLACK);	if (!s)		s = lasttext;        GrText(text, text_gc, 5, 14, s, strlen(s),0);	if (s != lasttext)		strcpy(lasttext, s);}     
开发者ID:BadrElh,项目名称:microwindows,代码行数:15,


示例20: draw_cursor

// draw the selector rectanglestatic void draw_cursor() {	show_cursor=1;	cursor_x = level[current_depth].cursor_pos%selection_size;	cursor_y = level[current_depth].cursor_pos/selection_size;	// update the screen with last picture	GrCopyArea(mandel_wid, mandel_gc, 0, 0,			   screen_width, screen_height,			   level[current_depth].mandel_buffer, 0, 0, MWROP_SRCCOPY);		GrSetGCForeground(mandel_gc, GR_RGB(BLACK));	GrRect(mandel_wid, mandel_gc, cursor_x*selection_width-1, cursor_y*selection_height-1, selection_width+2, selection_height+2);	GrSetGCForeground(mandel_gc, GR_RGB(WHITE));	GrRect(mandel_wid, mandel_gc, cursor_x*selection_width-2, cursor_y*selection_height-2, selection_width+4, selection_height+4);}
开发者ID:Keripo,项目名称:ProjectZeroSlackr-SVN,代码行数:15,


示例21: video_status_message

static void video_status_message(char *msg){	GR_SIZE txt_width, txt_height, txt_base;	GR_COORD txt_x, txt_y;	GrGetGCTextSize(video_gc, msg, -1, GR_TFASCII, &txt_width, &txt_height, &txt_base);	txt_x = (screen_info.cols - (txt_width + 10)) >> 1;	txt_y = (screen_info.rows - (txt_height + 10)) >> 1;	GrSetGCForeground(video_gc, GR_RGB(255,255,255));	GrFillRect(video_wid, video_gc, txt_x, txt_y, txt_width + 10, txt_height + 10);	GrSetGCForeground(video_gc, GR_RGB(0,0,0));	GrRect(video_wid, video_gc, txt_x, txt_y, txt_width + 10, txt_height + 10);	GrText(video_wid, video_gc, txt_x + 5, txt_y + txt_base + 5, msg, -1, GR_TFASCII);}
开发者ID:Keripo,项目名称:ProjectZeroSlackr-SVN,代码行数:14,


示例22: draw_pawn

/* Draw the pawn */void draw_pawn(int coord_x, int coord_y, char color){	if(color == 'w')	{		GrSetGCForeground(tuxchess_gc,GR_RGB(255,255,255));		GrFillEllipse(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+6,2,4);		GrSetGCForeground(tuxchess_gc,GR_RGB(0,0,0));		GrEllipse(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+6,2,4);		GrSetGCForeground(tuxchess_gc,GR_RGB(255,255,255));		GrFillRect(tuxchess_wid,tuxchess_gc,coord_x+3,coord_y+9,7,3);		GrSetGCForeground(tuxchess_gc,GR_RGB(0,0,0));		GrRect(tuxchess_wid,tuxchess_gc,coord_x+3,coord_y+9,7,3);	}	else 	{		GrSetGCForeground(tuxchess_gc,GR_RGB(0,0,0));		GrFillEllipse(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+6,2,4);		GrSetGCForeground(tuxchess_gc,GR_RGB(160,160,160));		GrEllipse(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+6,2,4);		GrSetGCForeground(tuxchess_gc,GR_RGB(0,0,0));		GrFillRect(tuxchess_wid,tuxchess_gc,coord_x+3,coord_y+9,7,3);		GrSetGCForeground(tuxchess_gc,GR_RGB(160,160,160));		GrRect(tuxchess_wid,tuxchess_gc,coord_x+3,coord_y+9,7,3);	}}
开发者ID:iPodLinux-Community,项目名称:ZacZilla,代码行数:26,


示例23: draw_cursor

/* Draw the cursor */void draw_cursor(char coord1, char coord2){	int x,y;	x = (coord1-65)*13;	y = 106-((coord2-48)*13);	GrSetGCForeground(tuxchess_gc,GR_RGB(255,255,255));	GrRect(tuxchess_wid,tuxchess_gc,x,y,13,13);	GrSetGCForeground(tuxchess_gc,GR_RGB(0,0,0));	GrRect(tuxchess_wid,tuxchess_gc,x+1,y+1,11,11);	GrSetGCForeground(tuxchess_gc,GR_RGB(255,255,255));	GrRect(tuxchess_wid,tuxchess_gc,x+2,y+2,9,9);}
开发者ID:iPodLinux-Community,项目名称:ZacZilla,代码行数:15,


示例24: tuxchess_draw_cursor

/* Draw the cursor */void tuxchess_draw_cursor(int coord_x, int coord_y){	GR_COLOR colour;	colour = (is_photo==0) ? WHITE : LIGHT_BLUE;	GrSetGCForeground(tuxchess_gc,colour);	GrRect(tuxchess_wid,tuxchess_gc,coord_x,coord_y,13,13);	colour = (is_photo==0) ? BLACK : DARK_BLUE;	GrSetGCForeground(tuxchess_gc,colour);	GrRect(tuxchess_wid,tuxchess_gc,coord_x+1,coord_y+1,11,11);	colour = (is_photo==0) ? WHITE : LIGHT_BLUE;	GrSetGCForeground(tuxchess_gc,colour);	GrRect(tuxchess_wid,tuxchess_gc,coord_x+2,coord_y+2,9,9);}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:15,


示例25: draw_pawn

/* Draw the pawn */void draw_pawn(int coord_x, int coord_y, int color){	if(color == 0)	{		GrSetGCForeground(tuxchess_gc,WHITE);		GrFillEllipse(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+6,2,4);		GrSetGCForeground(tuxchess_gc,BLACK);		GrEllipse(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+6,2,4);		GrSetGCForeground(tuxchess_gc,WHITE);		GrFillRect(tuxchess_wid,tuxchess_gc,coord_x+3,coord_y+9,7,3);		GrSetGCForeground(tuxchess_gc,BLACK);		GrRect(tuxchess_wid,tuxchess_gc,coord_x+3,coord_y+9,7,3);	}	else 	{		GrSetGCForeground(tuxchess_gc,BLACK);		GrFillEllipse(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+6,2,4);		GrSetGCForeground(tuxchess_gc,LTGRAY);		GrEllipse(tuxchess_wid,tuxchess_gc,coord_x+6,coord_y+6,2,4);		GrSetGCForeground(tuxchess_gc,BLACK);		GrFillRect(tuxchess_wid,tuxchess_gc,coord_x+3,coord_y+9,7,3);		GrSetGCForeground(tuxchess_gc,LTGRAY);		GrRect(tuxchess_wid,tuxchess_gc,coord_x+3,coord_y+9,7,3);	}}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:26,


示例26: draw_help

static void draw_help(){	//Hold:			Help Menu	//Play/Pause:	Start/Stay	//Action:		Hit	//Wheel:		Dec/Inc Bid	//Prev/Next:	Dec/Inc Bid	//Version:		X.XX	int i, width, height, depth;	char *help[] =	{	"Hold:", "Help",	"Play/Pause:", "Start/Stay",	"Action:", "Hit",	"Wheel:", "Dec/Inc Bid",	"Prev/Next:", "Dec/Inc Bid",	"", "",	"Version:", VERSION,	0	};	GrSetGCUseBackground(blackjack_gc, GR_TRUE);	GrSetGCBackground(blackjack_gc, WHITE);	GrSelectEvents(blackjack_wid, GR_EVENT_MASK_EXPOSURE|GR_EVENT_MASK_KEY_DOWN|				   GR_EVENT_MASK_KEY_UP|GR_EVENT_MASK_TIMER);	GrSetGCForeground(blackjack_gc, WHITE);	GrFillRect(blackjack_wid, blackjack_gc, 0, 0,			   screen_info.cols, screen_info.rows - HEADER_TOPLINE);	GrSetGCForeground(blackjack_gc, BLACK);	for(i=0; help[i] != 0; i++)	{		GrGetGCTextSize (blackjack_gc, help[i], -1, GR_TFASCII, &width, &height, &depth);		if(i % 2 == 0)		{			GrText(blackjack_wid, blackjack_gc, 5, (i * 7) + 20, help[i], -1, GR_TFASCII);		}else{			GrText(blackjack_wid, blackjack_gc,				   screen_info.cols - (width + 5),				  ((i - 1) * 7) + 20, help[i],  -1, GR_TFASCII);		}	}}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:50,


示例27: draw_itunes_parse

static void draw_itunes_parse(int cnt){	char str[10];	sprintf(str, "%i", cnt);	GrSetGCUseBackground(currentml->gc, GR_FALSE);	GrSetGCMode(currentml->gc, GR_MODE_SET);	GrSetGCForeground(currentml->gc, WHITE);	GrFillRect(currentml->wid, currentml->gc, 0,		   3 * currentml->gr_height,		   currentml->screen_info.cols, currentml->gr_height);	GrSetGCForeground(currentml->gc, BLACK);	GrText(currentml->wid, currentml->gc, 8, 3 * currentml->gr_height - 3,			str, -1, GR_TFASCII);}
开发者ID:iPodLinux,项目名称:iPodLinux-SVN,代码行数:15,


示例28: generator_draw_text

//displays the type of wave being played or PAUSEDvoid generator_draw_text(char *text ){	int width;		width = strlen(text)*7; 				//erase the previous 	GrSetGCForeground( generator_gc, WHITE );	GrFillRect( generator_wid, generator_gc, 0, 40, screen_info.cols, 30 );		//draw  	GrSetGCForeground( generator_gc, BLACK );	GrText( generator_wid, generator_gc, (screen_info.cols-width)/2, 60, text, -1, GR_TFASCII );}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:16,


示例29: invaders_DrawScene

static void invaders_DrawScene(){	aliens_slow--;	if(aliens_slow <= 0) {		GrSetGCForeground(invaders_gc, GR_RGB(255,255,255));		aliens_draw(itest);				itest = (itest != 0) ? 0 : 1;		aliens_update_position();				GrSetGCForeground(invaders_gc, GR_RGB(0,0,0));		aliens_draw(itest);				aliens_slow = aliens_left / 4 - level + 4;	}	/* evaluate if fire or not */	if((rand() % 10) == 0 && alien_firing < ALIEN_MAX_FIRES) {		/* find cols active and set relative row tostart */		int cols[ALIENS_COLS];		int i, j, ncol, hitcol;		alien_firing++;		ncol = 0;		for(i = 0; i < ALIENS_COLS; i++){			for(j = aliens_rows - 1; j >= 0; j--){				if(alien_status[i * aliens_rows + j] > 0) {					cols[ncol++] = j;					break;				}			}		}		hitcol=rand() % ncol;		Dprintf("%d/n", hitcol);		alienfire[alien_firing - 1].posx = cell_minx + hitcol *			ALIEN_CELL_WIDTH + ALIEN_CELL_WIDTH / 2;		alienfire[alien_firing - 1].posy = cell_miny + cols[hitcol] *			ALIEN_CELL_HEIGHT + ALIEN_CELL_HEIGHT;		alienfire[alien_firing-1].dir = 1;	}		GrSetGCForeground(invaders_gc, GR_RGB(255,255,255));	me_draw();	fire_draw();	fire_update();	GrSetGCForeground(invaders_gc, GR_RGB(0,0,0));	me_draw();	fire_draw();}
开发者ID:Keripo,项目名称:ProjectZeroSlackr-SVN,代码行数:48,


示例30: generator_draw_number

// Draws number sent over; clears the entire screen before drawing// Status: Donevoid generator_draw_number( int num ){	int i;	//used for looping		int width = (num > 999) ? 66 : (num > 99) ? 49 : (num > 9) ? 32 :  15;	// width of drawn numbers	int offset = (screen_info.cols - width) / 2;	// x pos of numbers	int top = 10;	// y pos of numbers	char str[sizeof(int)+1];		GrSetGCForeground( generator_gc, WHITE );	GrFillRect( generator_wid, generator_gc, 0, top, screen_info.cols, 25 );		sprintf( str, "%d", num );		for( i=0; i<4; i++ ) {		switch( str[i] ) {			case '0':	generator_zero( offset, top );		break;				case '1':	generator_one( offset, top );		break;			case '2':	generator_two( offset, top );		break;			case '3':	generator_three( offset, top );		break;			case '4':	generator_four( offset, top );		break;			case '5':	generator_five( offset, top );		break;			case '6':	generator_six( offset, top );		break;			case '7':	generator_seven( offset, top );		break;			case '8':	generator_eight( offset, top );		break;			case '9':	generator_nine( offset, top );		break;			case '-':	generator_dash( offset, top );		break;					}		offset += 17;	//increment the offset of one letter width + space	}}
开发者ID:ProjectZeroSlackr,项目名称:Floydzilla,代码行数:33,



注:本文中的GrSetGCForeground函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GrStringDraw函数代码示例
C++ GrSelectEvents函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。