本文整理汇总了C++中Graphics::FillPolygon方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphics::FillPolygon方法的具体用法?C++ Graphics::FillPolygon怎么用?C++ Graphics::FillPolygon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graphics
的用法示例。
在下文中一共展示了Graphics::FillPolygon方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: subrender
void Listlay::subrender()
{
Graphics *gfx = Graphics::FromImage(this->image);
gfx->Clear(CLR_WHITE);
Cacher *cacher = this->core->getCacher();
if( cacher != NULL ){
FwCHAR *string = NULL;
FwCHAR *name = NULL;
Cell *cell = NULL;
int i, x, y;
bool top, bot, archived = false;
top = false;
bot = false;
x = LST_X;
y = LST_Y;
for( i = -CACHE_SIZE; i < CACHE_SIZE; i++ ){
cacher->lockCache();
if( cacher->getCache() != NULL ){
cell = cacher->getCache()->gettoThat(i);
if( cell != NULL ){
if( cell->getFile() != NULL ){
name = cell->getFile()->getFileName();
}
if( name != NULL ){
if( i == 0 )
gfx->FillRectangle(this->Brush_LiteBack,0,y+1,OVL_SIZE,FONTSIZE+2);
string = name;
if( cell->getFile()->isArchived() == true ){
if( archived == false )
archived = true;
string = new FwCHAR(L"~");
string->mergeWith(name);
x = 3*LST_X;
}
else if( archived == true ){
archived = false;
x = LST_X;
}
gfx->DrawString(string->toWCHAR(),
string->toLength(),
this->Font_Default,
PointF((REAL)x,(REAL)y),
this->Brush_DarkBack);
if( archived == true )
delete string;
}
if( i == -1 && cacher->getCache()->isThatHead() == false )
top = true;
if( i == 1 && cacher->getCache()->isThatTail() == false )
bot = true;
}
}
cacher->unlockCache();
y += (FONTSIZE + 2);
}
int size = 3;
int width = 20;
int ax = (int)(OVL_SIZE/2);
int ay = LST_Y;
int asize = OVL_SIZE - 2*LST_Y;
Point arrow[3];
if( top == true ){
arrow[0].X = ax - width;
arrow[0].Y = ay;
arrow[1].X = ax;
arrow[1].Y = ay - width;
arrow[2].X = ax + width;
arrow[2].Y = ay;
gfx->FillPolygon(this->Brush_LiteBack,arrow,size);
}
if( bot == true ){
arrow[0].X = ax - width;
arrow[0].Y = ay + asize;
arrow[1].X = ax;
arrow[1].Y = ay + asize + width;
arrow[2].X = ax + width;
arrow[2].Y = ay + asize;
gfx->FillPolygon(this->Brush_LiteBack,arrow,size);
}
}
if( this->ticker > TICKER_OFF ){
int tsize = TICKER_SIZE;
int tx,ty;
if( this->ticker == 0 ){
tx = OVL_SIZE - 2*TICKER_INDENT;
ty = OVL_SIZE - 2*TICKER_INDENT;
}
if( this->ticker == 1 ){
tx = OVL_SIZE - TICKER_INDENT;
//.........这里部分代码省略.........
示例2: subrender
//.........这里部分代码省略.........
}
int frame = 2;
cacher->lockCache();
if( cacher->getCache() != NULL ){
cell = cacher->getThat();
if( cell != NULL ){
thumb = cell->getImageThumb();
if( thumb != NULL ){
gfx->FillRectangle(this->Brush_Back,
mx - THB_SIZE/4,
my - THB_SIZE/4,
THB_SIZE,
THB_SIZE);
gfx->DrawImage(thumb,
mx - THB_SIZE/4,
my - THB_SIZE/4,
THB_SIZE,
THB_SIZE);
gfx->DrawRectangle(this->Pen_Border,
mx - THB_SIZE/4,
my - THB_SIZE/4,
THB_SIZE,
THB_SIZE);
gfx->DrawRectangle( this->Pen_DarkBorder,
mx - frame - THB_SIZE/4,
my - frame - THB_SIZE/4,
THB_SIZE + 2*frame,
THB_SIZE + 2*frame );
}
}
}
cacher->unlockCache();
int size = 3;
int width = 10;
int ax = (int)(mx - frame - THB_SIZE/4);
int ay = (int)(my - frame - THB_SIZE/4);
int asize = THB_SIZE + 2*frame;
Point arrow[3];
if( top == true ){
arrow[0].X = (int)(ax + (THB_SIZE/2) - width);
arrow[0].Y = ay;
arrow[1].X = (int)(ax + (THB_SIZE/2));
arrow[1].Y = ay - width;
arrow[2].X = (int)(ax + (THB_SIZE/2) + width);
arrow[2].Y = ay;
gfx->FillPolygon(this->Brush_DarkBack,arrow,size);
}
if( bot == true ){
arrow[0].X = (int)(ax + (THB_SIZE/2) - width);
arrow[0].Y = ay + asize;
arrow[1].X = (int)(ax + (THB_SIZE/2));
arrow[1].Y = ay + asize + width;
arrow[2].X = (int)(ax + (THB_SIZE/2) + width);
arrow[2].Y = ay + asize;
gfx->FillPolygon(this->Brush_DarkBack,arrow,size);
}
if( left == true ){
arrow[0].X = ax;
arrow[0].Y = (int)(ay + (THB_SIZE/2) - width);
arrow[1].X = ax - width;
arrow[1].Y = (int)(ay + (THB_SIZE/2));
arrow[2].X = ax;
arrow[2].Y = (int)(ay + (THB_SIZE/2) + width);
gfx->FillPolygon(this->Brush_DarkBack,arrow,size);
}
if( right == true ){
arrow[0].X = ax + asize;
arrow[0].Y = (int)(ay + (THB_SIZE/2) - width);
arrow[1].X = ax + asize + width;
arrow[1].Y = (int)(ay + (THB_SIZE/2));
arrow[2].X = ax + asize;
arrow[2].Y = (int)(ay + (THB_SIZE/2) + width);
gfx->FillPolygon(this->Brush_DarkBack,arrow,size);
}
}
if( this->ticker > TICKER_OFF ){
int tsize = TICKER_SIZE;
int tx,ty;
if( this->ticker == 0 ){
tx = OVL_SIZE - 2*TICKER_INDENT;
ty = OVL_SIZE - 2*TICKER_INDENT;
}
if( this->ticker == 1 ){
tx = OVL_SIZE - TICKER_INDENT;
ty = OVL_SIZE - 2*TICKER_INDENT;
}
if( this->ticker == 2 ){
tx = OVL_SIZE - TICKER_INDENT;
ty = OVL_SIZE - TICKER_INDENT;
}
if( this->ticker == 3 ){
tx = OVL_SIZE - 2*TICKER_INDENT;
ty = OVL_SIZE - TICKER_INDENT;
}
gfx->FillRectangle(this->Brush_DarkBack,tx,ty,tsize,tsize);
}
delete gfx;
}
示例3: blackPen
void
MFCClipItemView::Draw(Graphics &dc, CRect &clipBox)
{
// !!!??? need to clip properly for short instances with long names
cerr << "clip item draw " << item->sym->name << endl;
Pen blackPen(Color(250, 0, 0, 0), 1);
Pen redPen(Color(250, 238, 100, 100), 1);
Pen orangePen(Color(200, 250, 150, 10), 1);
SolidBrush blueBrush(Color(100, 100, 100, 238));
SolidBrush blackBrush(Color(200, 0, 0, 0));
SolidBrush orangeBrush(Color(190, 250, 150, 10));
dc.DrawLine( &orangePen, bounds.left, 0, bounds.left, bounds.bottom);
bool isMarker = false;
if (item != NULL && item->duration.ticks <= 0) {
isMarker = true;
}
if (!isMarker) {
dc.DrawLine( &orangePen, bounds.right, 0, bounds.right, bounds.bottom);
}
PointF tri[3];
Font labelFont(L"Arial", 8.0, FontStyleRegular, UnitPoint, NULL);
wstring nm;
const char *cp = item->sym->uniqueName();
while (*cp) {
nm.push_back(*cp++);
}
PointF p;
UINT py = 0;
do {
if (!isMarker) {
// a triangle bit
tri[0].X = bounds.left; tri[0].Y = py;
tri[1].X = bounds.left+6; tri[1].Y = py+3;
tri[2].X = bounds.left; tri[2].Y = py+6;
dc.FillPolygon(&orangeBrush, tri, 3);
}
p.X = bounds.left-1;
p.Y = py+5;
RectF box;
StringFormat sff = StringFormatFlagsDirectionVertical;
dc.MeasureString(nm.c_str(), -1, &labelFont, p, &sff, &box);
dc.DrawString(nm.c_str(), -1, &labelFont, box, &sff, &blackBrush);
if (!isMarker) {
// a nother triangle bit
tri[0].X = bounds.right;
tri[1].X = bounds.right-6;
tri[2].X = bounds.right;
dc.FillPolygon(&orangeBrush, tri, 3);
p.X = bounds.right-10;
p.Y = py+5;
dc.MeasureString(nm.c_str(), -1, &labelFont, p, &sff, &box);
dc.DrawString(nm.c_str(), -1, &labelFont, box, &sff, &blackBrush);
}
py += editor->bounds.bottom;
} while (py < bounds.bottom);
}