本文整理汇总了C++中PSD::FillRect方法的典型用法代码示例。如果您正苦于以下问题:C++ PSD::FillRect方法的具体用法?C++ PSD::FillRect怎么用?C++ PSD::FillRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PSD
的用法示例。
在下文中一共展示了PSD::FillRect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: malloc
//.........这里部分代码省略.........
/*GsCloseSocket();*/
GdCloseScreen(psd);
GdCloseKeyboard();
free(wp);
return -1;
}
/*
* Create std font.
*/
#if (HAVE_BIG5_SUPPORT | HAVE_GB2312_SUPPORT | HAVE_JISX0213_SUPPORT | HAVE_KSC5601_SUPPORT)
/* system fixed font looks better when mixed with builtin fixed fonts*/
stdfont = GdCreateFont(psd, MWFONT_SYSTEM_FIXED, 0, NULL);
#else
stdfont = GdCreateFont(psd, MWFONT_SYSTEM_VAR, 0, NULL);
#endif
/*
* Initialize the root window.
*/
wp->psd = psd;
wp->id = GR_ROOT_WINDOW_ID;
wp->parent = NULL; /* changed: was = NULL*/
wp->owner = NULL;
wp->children = NULL;
wp->siblings = NULL;
wp->next = NULL;
wp->x = 0;
wp->y = 0;
wp->width = psd->xvirtres;
wp->height = psd->yvirtres;
wp->bordersize = 0;
wp->background = BLACK;
wp->bordercolor = wp->background;
wp->nopropmask = 0;
wp->bgpixmap = NULL;
wp->bgpixmapflags = GR_BACKGROUND_TILE;
wp->eventclients = NULL;
wp->cursorid = 0;
wp->mapped = GR_TRUE;
wp->realized = GR_TRUE;
wp->output = GR_TRUE;
wp->props = 0;
wp->title = NULL;
wp->clipregion = NULL;
listpp = NULL;
listwp = wp;
rootwp = wp;
focuswp = wp;
mousewp = wp;
focusfixed = GR_FALSE;
/*
* Initialize and position the default cursor.
*/
curcursor = NULL;
cursorx = -1;
cursory = -1;
GdShowCursor(psd);
GsMoveCursor(psd->xvirtres / 2, psd->yvirtres / 2);
SERVER_UNLOCK();
cid = GrNewCursor(16, 16, 0, 0, WHITE, BLACK, cursorbits, cursormask);
GrSetWindowCursor(GR_ROOT_WINDOW_ID, cid);
SERVER_LOCK();
stdcursor = GsFindCursor(cid);
#if VTSWITCH
MwInitVt();
/* Check for VT change every 50 ms: */
GdAddTimer(50, CheckVtChange, NULL);
#endif
psd->FillRect(psd, 0, 0, psd->xvirtres-1, psd->yvirtres-1,
GdFindColor(psd, wp->background));
/*
* Tell the mouse driver some things.
*/
curbuttons = 0;
GdRestrictMouse(0, 0, psd->xvirtres - 1, psd->yvirtres - 1);
GdMoveMouse(psd->xvirtres / 2, psd->yvirtres / 2);
/* Force root window screen paint*/
GsRedrawScreen();
/*
* Force the cursor to appear on the screen at startup.
* (not required with above GsRedrawScreen)
GdHideCursor(psd);
GdShowCursor(psd);
*/
/*
* All done.
*/
connectcount = 0;
return 0;
}
示例2:
/*
* Open low level graphics driver
*/
PSD
GdOpenScreen(void)
{
PSD psd;
MWPALENTRY * stdpal;
MWSCREENINFO sinfo;
psd = scrdev.Open(&scrdev);
if (!psd)
return NULL;
GdGetScreenInfo(psd, &sinfo);
gr_pixtype = sinfo.pixtype;
gr_ncolors = sinfo.ncolors;
/* assume no user changable palette entries*/
gr_firstuserpalentry = (int)psd->ncolors;
/* set palette according to system colors and devpalX.c*/
switch((int)psd->ncolors) {
#if !defined(NOSTDPAL1) /* don't require stdpal1 if not needed */
case 2: /* 1bpp*/
{
extern MWPALENTRY mwstdpal1[2];
stdpal = mwstdpal1;
}
break;
#endif
#if !defined(NOSTDPAL2) /* don't require stdpal2 if not needed */
case 4: /* 2bpp*/
{
extern MWPALENTRY mwstdpal2[4];
stdpal = mwstdpal2;
}
break;
#endif
#if !defined(NOSTDPAL4)
/* don't require stdpal4 if not needed */
case 8: /* 3bpp - not fully supported*/
case 16: /* 4bpp*/
{
extern MWPALENTRY mwstdpal4[16];
stdpal = mwstdpal4;
}
break;
#endif
#if !defined(NOSTDPAL8) /* don't require large stdpal8 if not needed */
case 256: /* 8bpp*/
{
extern MWPALENTRY mwstdpal8[256];
#if xxxALPHABLEND
/* don't change uniform palette if alpha blending*/
gr_firstuserpalentry = 256;
#else
/* start after last system-reserved color*/
gr_firstuserpalentry = FIRSTUSERPALENTRY;
#endif
stdpal = mwstdpal8;
}
break;
#endif /* !defined(NOSTDPAL8)*/
default: /* truecolor*/
/* no palette*/
gr_firstuserpalentry = 0;
stdpal = NULL;
}
/* reset next user palette entry, write hardware palette*/
GdResetPalette();
GdSetPalette(psd, 0, (int)psd->ncolors, stdpal);
#if xxxALPHABLEND
/* one-time create alpha lookup table for 8bpp systems (takes ~1 sec)*/
if(psd->ncolors == 256)
init_alpha_lookup();
#endif
#if !NOFONTSORCLIPPING
/* init local vars*/
GdSetMode(MWMODE_COPY);
GdSetForeground(GdFindColor(MWRGB(255, 255, 255))); /* WHITE*/
GdSetBackground(GdFindColor(MWRGB(0, 0, 0))); /* BLACK*/
GdSetUseBackground(TRUE);
GdSetFont(GdCreateFont(psd, MWFONT_SYSTEM_VAR, 0, NULL));
#if DYNAMICREGIONS
GdSetClipRegion(psd,
GdAllocRectRegion(0, 0, psd->xvirtres, psd->yvirtres));
#else
GdSetClipRects(psd, 0, NULL);
#endif /* DYNAMICREGIONS*/
#endif /* NOFONTSORCLIPPING*/
/* fill black (actually fill to first palette entry or truecolor 0*/
psd->FillRect(psd, 0, 0, psd->xvirtres-1, psd->yvirtres-1, 0);
//.........这里部分代码省略.........
示例3: MWRGB
/**
* Open low level graphics driver.
*
* @return The screen drawing surface.
*/
PSD
GdOpenScreen(void)
{
PSD psd;
MWPALENTRY * stdpal;
psd = scrdev.Open(&scrdev);
if (!psd)
return NULL;
/* assume no user changable palette entries*/
gr_firstuserpalentry = (int)psd->ncolors;
/* set palette according to system colors and devpalX.c*/
switch((int)psd->ncolors) {
#if !defined(NOSTDPAL1) /* don't require stdpal1 if not needed */
case 2: /* 1bpp*/
{
extern MWPALENTRY mwstdpal1[2];
stdpal = mwstdpal1;
}
break;
#endif
#if !defined(NOSTDPAL2) /* don't require stdpal2 if not needed */
case 4: /* 2bpp*/
{
extern MWPALENTRY mwstdpal2[4];
stdpal = mwstdpal2;
}
break;
#endif
#if !defined(NOSTDPAL4)
/* don't require stdpal4 if not needed */
case 8: /* 3bpp - not fully supported*/
case 16: /* 4bpp*/
{
extern MWPALENTRY mwstdpal4[16];
stdpal = mwstdpal4;
}
break;
#endif
#if !defined(NOSTDPAL8) /* don't require large stdpal8 if not needed */
case 256: /* 8bpp*/
{
extern MWPALENTRY mwstdpal8[256];
#if UNIFORMPALETTE
/* don't change uniform palette if alpha blending*/
gr_firstuserpalentry = 256;
#else
/* start after last system-reserved color*/
gr_firstuserpalentry = FIRSTUSERPALENTRY;
#endif
stdpal = mwstdpal8;
}
break;
#endif /* !defined(NOSTDPAL8)*/
default: /* truecolor*/
/* no palette*/
gr_firstuserpalentry = 0;
stdpal = NULL;
}
/* reset next user palette entry, write hardware palette*/
GdResetPalette();
GdSetPalette(psd, 0, (int)psd->ncolors, stdpal);
/* init local vars*/
GdSetMode(MWROP_COPY);
GdSetFillMode(MWFILL_SOLID); /* Set the fill mode to solid */
GdSetForegroundColor(psd, MWRGB(255, 255, 255)); /* WHITE*/
GdSetBackgroundColor(psd, MWRGB(0, 0, 0)); /* BLACK*/
GdSetUseBackground(TRUE);
/* select first builtin font (usually MWFONT_SYSTEM_VAR)*/
//GdSetFont(GdCreateFont(psd, NULL, 0, 0, NULL));
GdSetDash(0, 0); /* No dashing to start */
GdSetStippleBitmap(0,0,0); /* No stipple to start */
#if !NOCLIPPING
#if DYNAMICREGIONS
GdSetClipRegion(psd, GdAllocRectRegion(0, 0, psd->xvirtres, psd->yvirtres));
#else
GdSetClipRects(psd, 0, NULL);
#endif /* DYNAMICREGIONS*/
#endif /* NOCLIPPING*/
/* fill black (actually fill to first palette entry or truecolor 0*/
psd->FillRect(psd, 0, 0, psd->xvirtres-1, psd->yvirtres-1, 0);
return psd;
//.........这里部分代码省略.........