本文整理汇总了C++中gdiplus::Graphics::FillEllipse方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphics::FillEllipse方法的具体用法?C++ Graphics::FillEllipse怎么用?C++ Graphics::FillEllipse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gdiplus::Graphics
的用法示例。
在下文中一共展示了Graphics::FillEllipse方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawGame
void DrawGame(Gdiplus::Graphics &graphics, Game ¤tGame)
{
// Draw background.
graphics.FillRectangle(MY_WHITE_BRUSH, 0, 0, MAIN_WINDOW_WIDTH, MAIN_WINDOW_HEIGHT);
// Draw end.
const MazeState ¤tMazeState = currentGame.CurrentState();
graphics.FillRectangle(
WEAK_BLACK_BRUSH,
static_cast<INT>(currentMazeState.end[0] * MAZE_GRID_CELL_SIZE + 2),
static_cast<INT>(currentMazeState.end[1] * MAZE_GRID_CELL_SIZE + 2),
static_cast<INT>(MAZE_GRID_CELL_SIZE - 5),
static_cast<INT>(MAZE_GRID_CELL_SIZE - 5));
// Draw player.
graphics.FillEllipse(
MY_RED_BRUSH,
static_cast<INT>(currentMazeState.currentPosition[0] * MAZE_GRID_CELL_SIZE + 2),
static_cast<INT>(currentMazeState.currentPosition[1] * MAZE_GRID_CELL_SIZE + 2),
static_cast<INT>(MAZE_GRID_CELL_SIZE - 4),
static_cast<INT>(MAZE_GRID_CELL_SIZE - 4));
// Draw maze jumps.
int numJumps = currentMazeState.jumps.size();
for (int i = 0; i < numJumps; ++i) {
graphics.FillEllipse(
MY_BLUE_BRUSH,
static_cast<INT>(currentMazeState.jumps[i].array[0] * MAZE_GRID_CELL_SIZE + 3),
static_cast<INT>(currentMazeState.jumps[i].array[1] * MAZE_GRID_CELL_SIZE + 3),
static_cast<INT>(MAZE_GRID_CELL_SIZE - 5),
static_cast<INT>(MAZE_GRID_CELL_SIZE - 5));
}
// Draw maze.
graphics.DrawRectangle(
MY_BLACK_PEN,
0, 0,
MAZE_GRID_CELL_SIZE * MAZE_GRID_WIDTH, MAZE_GRID_CELL_SIZE * MAZE_GRID_HEIGHT);
for (int j = 0; j < MAZE_GRID_HEIGHT; ++j) {
for (int i = 0; i < MAZE_GRID_WIDTH; ++i) {
if (currentMazeState.cellFlags[j][i] & CELL_WALL_UP) {
graphics.DrawLine(
MY_BLACK_PEN,
static_cast<INT>(MAZE_GRID_CELL_SIZE * i), static_cast<INT>(MAZE_GRID_CELL_SIZE * j),
static_cast<INT>(MAZE_GRID_CELL_SIZE * (i+1)), static_cast<INT>(MAZE_GRID_CELL_SIZE * j));
}
if (currentMazeState.cellFlags[j][i] & CELL_WALL_LEFT) {
graphics.DrawLine(
MY_BLACK_PEN,
static_cast<INT>(MAZE_GRID_CELL_SIZE * i), static_cast<INT>(MAZE_GRID_CELL_SIZE * j),
static_cast<INT>(MAZE_GRID_CELL_SIZE * i), static_cast<INT>(MAZE_GRID_CELL_SIZE * (j+1)));
}
}
}
}
示例2: fill_ellipse
void fill_ellipse(ft x, ft y, ft w, ft h)
{
Gdiplus::SolidBrush* brush = new Gdiplus::SolidBrush(*color);
graphics->FillEllipse(brush, Gdiplus::Rect((st)x, (st)y, (st)w, (st)h));
delete brush;
}
示例3: PluginUpdateOverlay
//
// Draw overlay
//
PLUGIN_EXPORT void PluginUpdateOverlay()
{
if (!pRenderHelper)
return;
//SAFE_DELETE(pFPSNormalBrush);
//pFPSNormalBrush = new Gdiplus::SolidBrush(Gdiplus::Color(255, 255, 255, 255));
if (bFirstAttach) {
bFirstAttach = false;
PC_StartRecording();
PC_DebugPrint(L"Triggered");
}
else {
PC_DebugPrint(L"Not Triggered");
}
// lock overlay image
auto pLock = pRenderHelper->BeginFrame();
if (!pLock)
return;
int w = pLock->dwWidth;
int h = pLock->dwHeight;
Gdiplus::Graphics *pGraphics = pRenderHelper->GetGraphics();
//-----------------------------------------
// draw FPS counter
// set options
//pGraphics->SetTextRenderingHint(Gdiplus::TextRenderingHintAntiAlias);
// clear back
pGraphics->Clear(Gdiplus::Color(0, 0, 0, 0));
// draw fps
{
Gdiplus::RectF bound;
//bound.
int circleSize = 0;
if (w < h) {
circleSize = w;
}
else {
circleSize = h;
}
if (PC_IsRecording()) {
pGraphics->FillEllipse(pFPSRecordBrush, 0, 0, circleSize, circleSize);
}
else if (bShowWhenNotRecording) {
pGraphics->FillEllipse(pFPSNormalBrush, 0, 0, circleSize, circleSize);
}
}
// graphics.Flush(FlushIntentionSync);
// fill overlay image
pRenderHelper->EndFrame();
}
示例4: FillEllipse
void Graphics::FillEllipse(Brush* brush, const Rect& rc) {
Gdiplus::Graphics* g = reinterpret_cast<Gdiplus::Graphics*>(_private);
Gdiplus::Brush* gdiBrush = reinterpret_cast<Gdiplus::Brush*>(brush->_private);
g->FillEllipse(gdiBrush, ToGDIRect<Rect, Gdiplus::Rect>(rc));
}