本文整理汇总了C++中drawCircle函数的典型用法代码示例。如果您正苦于以下问题:C++ drawCircle函数的具体用法?C++ drawCircle怎么用?C++ drawCircle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drawCircle函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main(){
initializePrinter();
drawCanvas(0,0,0,255);
int x,y;
y = getYRes()/2;
x = getXRes()/2;
circle C = makeCircle(0,0,0,255,20,x,y);
for (i=0;i<=360;i++) {
rotateCircle(C,i,x,y);
drawCircle(C);
}
printToScreen();
finishPrinter();
}
开发者ID:GrafikaNECT,项目名称:tembakkapal-transformasi,代码行数:14,代码来源:mcircle.c
示例2: drawCircle
/*!
* \brief drawCircle
* \param img image data
* \param img_width image width
* \param img_height image height
* \param x x coordinate
* \param y y coordinate
* \param radius radius of the circle
* \param r red
* \param g green
* \param b blue
* \param line_width width of the line
*/
void drawing::drawCircle(
unsigned char* img,
int img_width,
int img_height,
int x,
int y,
int radius,
int r,
int g,
int b,
int line_width)
{
drawCircle(img, img_width, img_height, (float)x, (float)y, (float)radius, r, g, b, line_width);
}
开发者ID:Artens,项目名称:openanpr,代码行数:27,代码来源:drawing.cpp
示例3: cvZero
// Draw graphs -- todo, adjust to fit in window
void Painting::drawGraph()
{
// Paint the canvas white
cvZero(mImage);
cvRectangleR(mImage,cvRect(0,0,500,500),cvScalar(255,255,255), -1);
CvFont font;
double hScale=0.5;
double vScale=0.5;
int lineWidth=1;
cvInitFont(&font,CV_FONT_HERSHEY_SIMPLEX|CV_FONT_ITALIC, hScale,vScale,0,lineWidth);
// Add text to canvas
cvPutText (mImage,"Left",cvPoint(20,50), &font, cvScalar(200,0,0));
cvPutText (mImage,"Right",cvPoint(420,50), &font, cvScalar(0,200,0));
// Iterate the vector of data and center the selected objects
if(mData.size())
{
int xScale = 200;
int yScale = 20;
int xOffSet = 250 - mData[mSelect].timeStamp * xScale;
int yOffSet1 = 240 + mData[mSelect].pulsefreq * yScale;
int yOffSet2 = 250 + mData[mSelect].blinkingfreq * yScale;
int yOffSet3 = 260 + mData[mSelect].breathingfreq * yScale;
int t = 1; //thick
if(mSelect == 0)
t = -1;
drawCircle(mImage,cvPoint(mData[0].timeStamp * xScale + xOffSet,yOffSet1 - mData[0].pulsefreq * yScale),0,t);
drawCircle(mImage,cvPoint(mData[0].timeStamp * xScale + xOffSet,yOffSet2 - mData[0].blinkingfreq * yScale),1,t);
drawCircle(mImage,cvPoint(mData[0].timeStamp * xScale + xOffSet,yOffSet3 - mData[0].breathingfreq * yScale),2,t);
for(unsigned int i = 1; i<mData.size(); i++)
{
int thick = 1;
if((unsigned)mSelect == i)
thick = -1;
// Pulse
drawCircle(mImage,cvPoint(mData[i].timeStamp * xScale + xOffSet, yOffSet1 - mData[i].pulsefreq * yScale),0,thick);
cvLine(mImage,cvPoint(mData[i].timeStamp * xScale + xOffSet, yOffSet1 - mData[i].pulsefreq * yScale),
cvPoint(mData[i-1].timeStamp * xScale + xOffSet, yOffSet1 - mData[i-1].pulsefreq * yScale),cvScalar(0,0,255));
// Blinking
drawCircle(mImage,cvPoint(mData[i].timeStamp * xScale + xOffSet, yOffSet2 - mData[i].blinkingfreq * yScale),1,thick);
cvLine(mImage,cvPoint(mData[i].timeStamp * xScale + xOffSet, yOffSet2 - mData[i].blinkingfreq * yScale),
cvPoint(mData[i-1].timeStamp * xScale + xOffSet, yOffSet2 - mData[i-1].blinkingfreq * yScale),cvScalar(0,255,0));
// Breathing
drawCircle(mImage,cvPoint(mData[i].timeStamp * xScale + xOffSet, yOffSet3 - mData[i].breathingfreq * yScale),2,thick);
cvLine(mImage,cvPoint(mData[i].timeStamp * xScale + xOffSet, yOffSet3 - mData[i].breathingfreq * yScale),
cvPoint(mData[i-1].timeStamp * xScale + xOffSet, yOffSet3 - mData[i-1].breathingfreq * yScale),cvScalar(255,0,0));
}
}
cvShowImage(WindowName, mImage);
}
开发者ID:fatma-meawad,项目名称:food-recognition-project,代码行数:58,代码来源:painting.cpp
示例4: drawCircle
// ---
void QGAMES::Screen::drawCircle (const QGAMES::Position& p, const QGAMES::Vector& o,
QGAMES::bdata a1, QGAMES::bdata a2, const QGAMES::Color& c, bool f)
{
// Calculates the real position at the screen
// It would depend on the scale, and where the visual position f the screen is fixed.
QGAMES::Position nP = p.projectOver (_position, _orientation);
QGAMES::bdata x = nP.posX () - _position.posX ();
QGAMES::bdata y = nP.posY () - _position.posY ();
QGAMES::bdata a1D = a1; QGAMES::bdata a2D = a2;
// It is too mcuh difficult to verify whether
// the final eelipse fits or not the window...
// Scale the objects...if any
if ((int) _scale._value != 1) // To speed the code up in normal situations...
{
x = _scale.effectToX (x);
y = _scale.effectToY (y);
if (_scale._scaleByAlgorithm)
{
a1D = a1 * _scale._value; // axis 1 and axis 2 have to be scaled also...
a2D = a2 * _scale._value;
}
}
// Draw the objects...
if ((int) _scale._value == 1)
drawCircle ((int) x, (int) y, (int) a1D, (int) a2D, c, f);
else
{
if (!_scale._scaleByAlgorithm)
activeScale ();
drawCircle ((int) x, (int) y, (int) a1D, (int) a2D, c, f);
if (!_scale._scaleByAlgorithm)
desactiveScale ();
}
}
开发者ID:Commnets,项目名称:QGAMES,代码行数:38,代码来源:screen.cpp
示例5: Garmata
void Garmata()
{
//jadro
glColor3f(0.0, 0.0, 0.0);
drawCircle( gfPyshkaX, gfPyshkaY, 14,60);
glEnd();
//kinec garmatu
glColor3f(0.0, 0.0, 0.0);
drawCircle( -70+gfPyshkaX1, 44+gfPyshkaY1, 14,60);
glEnd();
//Garmata zamalovka
glBegin(GL_QUADS);
glColor3f(1.0, 1.0, 1.0);
glVertex2i(-70+gfPyshkaX1, 30+gfPyshkaY1);
glColor3f(1.0, 1.0, 1.0);
glVertex2i(200+gfPyshkaX1, 30+gfPyshkaY1);
glColor3f(1.0, 1.0, 1.0);
glVertex2i(200+gfPyshkaX1, 58+gfPyshkaY1);
glColor3f(1.0, 1.0, 1.0);
glVertex2i(-70+gfPyshkaX1, 58+gfPyshkaY1);
glEnd();
//Garmata
glBegin(GL_LINE_LOOP);
glColor3f(0.0, 0.0, 0.0);
glVertex2i(-70+gfPyshkaX1, 30+gfPyshkaY1);
glColor3f(0.0, 0.0, 0.0);
glVertex2i(200+gfPyshkaX1, 30+gfPyshkaY1);
glColor3f(0.0, 0.0, 0.0);
glVertex2i(200+gfPyshkaX1, 58+gfPyshkaY1);
glColor3f(0.0, 0.0, 0.0);
glVertex2i(-70+gfPyshkaX1, 58+gfPyshkaY1);
glEnd();
//koleso vid pushki
glColor3f(0.0, 0.0, 0.0);
drawCircle(0+gfPyshkaX1, 0+gfPyshkaY1, 30,60);
}
开发者ID:PLuSS-ksa,项目名称:PLuSS,代码行数:36,代码来源:Vidformatovano.cpp
示例6: color565
void DeviceAddScreen::render()
{
uint16_t schcolor = color565(142,35,35);
fillScreen(BLACK);
makeRectangle(15,15, 200,280, BLACK, 5);
drawPgmString(210,50 , PSTR("ADD ADAPTERS"), schcolor, BLACK, 2);
drawPgmString(180,50, PSTR("While this screen is open, devices will"), WHITE, BLACK, 1);
drawPgmString(170,50, PSTR("synchronize with the basestation. Press"), WHITE, BLACK, 1);
drawPgmString(160,50, PSTR("and hold HOME or BACK to exit."), WHITE, BLACK, 1);
drawCircle(100, 100, 30, WHITE);
drawCircle(100, 220, 30, WHITE);
drawHorizontalLine(100, 130, 60, WHITE, 1);
// 100, 190 is point of arrow
for(int8_t i=0; i < 8; i++) {
drawPixel(100-i, 190-i, WHITE);
drawPixel(100+i, 190-i, WHITE);
}
for(int8_t i=0; i < 8; i++) {
drawPixel(100-i, 130+i, WHITE);
drawPixel(100+i, 130+i, WHITE);
}
}
开发者ID:unregistered,项目名称:lg-activate,代码行数:24,代码来源:lgui.c
示例7: drawLine
void drawLine(int x2, int y2, int x1, int y1){
int dx = x1 - x2;
int dy = y1 - y2;
int t_max = abs(dx);
if (abs(dy) > abs(dx))
t_max = abs(dy);
if (t_max == 0){
drawCircle(x1, y1);
}
else{
double ddx = double(dx)/double(t_max);
double ddy = double(dy)/double(t_max);
double x=x2;
double y=y2;
for(int t=0;t<=t_max;++t){
drawCircle((int)round(x),(int)round(y));
x += ddx;
y += ddy;
}
}
}
开发者ID:opiette,项目名称:wxsand,代码行数:24,代码来源:Canvas.cpp
示例8: clear_to_color
void CustomCircle::takePoint(Point p)
{
p2.x = p.x;
p2.y = p.y;
if (!On)
{
On = true;
p1.x = p.x;
p1.y = p.y;
}
clear_to_color(bmp, TRANSPARENT);
drawCircle(bmp, p1, pointDistance(p1, p2), GREEN);
}
开发者ID:leomarques,项目名称:Dickbox,代码行数:15,代码来源:CustomCircle.cpp
示例9: update
//---------------------------------------------------------------------
void TitleDraw::update()
{
//---- main content
int state = title_state->getNowState();
if (state == TitleState::STATE_CIRCLE) { drawCircle(); }
if (state == TitleState::STATE_TITLE) { drawTitle(); }
//---- fadeout/fadein
SetDrawBlendMode(DX_BLENDMODE_ALPHA, title_state->getAlpha());
DrawBox(0, 0,
SystemData::getInstance()->getWindowWidth(),
SystemData::getInstance()->getWindowHeight(),
GetColor(0, 0, 0), TRUE);
SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
}
开发者ID:tapi-soft,项目名称:poseine,代码行数:16,代码来源:TitleDraw.cpp
示例10: main
int main( void )
{
GLFWwindow *window;
// Initialize the library
if ( !glfwInit( ) )
{
return -1;
}
// Create a windowed mode window and its OpenGL context
window = glfwCreateWindow( SCREEN_WIDTH, SCREEN_HEIGHT, "Hello World", NULL, NULL );
if ( !window )
{
glfwTerminate( );
return -1;
}
// Make the window's context current
glfwMakeContextCurrent( window );
glViewport( 0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT ); // specifies the part of the window to which OpenGL will draw (in pixels), convert from normalised to pixels
glMatrixMode( GL_PROJECTION ); // projection matrix defines the properties of the camera that views the objects in the world coordinate frame. Here you typically set the zoom factor, aspect ratio and the near and far clipping planes
glLoadIdentity( ); // replace the current matrix with the identity matrix and starts us a fresh because matrix transforms such as glOrpho and glRotate cumulate, basically puts us at (0, 0, 0)
glOrtho( 0, SCREEN_WIDTH, 0, SCREEN_HEIGHT, 0, 1 ); // essentially set coordinate system
glMatrixMode( GL_MODELVIEW ); // (default matrix mode) modelview matrix defines how your objects are transformed (meaning translation, rotation and scaling) in your world
glLoadIdentity( ); // same as above comment
// Loop until the user closes the window
while ( !glfwWindowShouldClose( window ) )
{
glClear( GL_COLOR_BUFFER_BIT );
// render OpenGL here
drawCircle( SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, 0, 120, 10 );
// Swap front and back buffers
glfwSwapBuffers( window );
// Poll for and process events
glfwPollEvents( );
}
glfwTerminate( );
return 0;
}
开发者ID:Ajloun-National-University,项目名称:OpenGL-Tutorials,代码行数:48,代码来源:main.cpp
示例11: Q_FOREACH
void QgsPointDisplacementRenderer::drawGroup( QPointF centerPoint, QgsRenderContext& context, const ClusteredGroup& group )
{
//calculate max diagonal size from all symbols in group
double diagonal = 0;
Q_FOREACH ( const GroupedFeature& feature, group )
{
if ( QgsMarkerSymbol* symbol = feature.symbol )
{
diagonal = qMax( diagonal, context.convertToPainterUnits( M_SQRT2 * symbol->size(),
symbol->sizeUnit(), symbol->sizeMapUnitScale() ) );
}
}
QgsSymbolRenderContext symbolContext( context, QgsUnitTypes::RenderMillimeters, 1.0, false );
QList<QPointF> symbolPositions;
QList<QPointF> labelPositions;
double circleRadius = -1.0;
calculateSymbolAndLabelPositions( symbolContext, centerPoint, group.size(), diagonal, symbolPositions, labelPositions, circleRadius );
//draw circle
if ( circleRadius > 0 )
drawCircle( circleRadius, symbolContext, centerPoint, group.size() );
if ( group.size() > 1 )
{
//draw mid point
QgsFeature firstFeature = group.at( 0 ).feature;
if ( mCenterSymbol )
{
mCenterSymbol->renderPoint( centerPoint, &firstFeature, context, -1, false );
}
else
{
context.painter()->drawRect( QRectF( centerPoint.x() - symbolContext.outputLineWidth( 1 ), centerPoint.y() - symbolContext.outputLineWidth( 1 ), symbolContext.outputLineWidth( 2 ), symbolContext.outputLineWidth( 2 ) ) );
}
}
//draw symbols on the circle
drawSymbols( group, context, symbolPositions );
//and also the labels
if ( mLabelIndex >= 0 )
{
drawLabels( centerPoint, symbolContext, labelPositions, group );
}
}
开发者ID:wongjimsan,项目名称:QGIS,代码行数:48,代码来源:qgspointdisplacementrenderer.cpp
示例12: myMouse
extern void myMouse(int button, int state, int x, int y)
{
if (state == GLUT_DOWN) {
if (button == GLUT_LEFT_BUTTON) {
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
drawAxis();
glFlush();
} else if (button == GLUT_RIGHT_BUTTON) {
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
drawCircle();
glFlush();
}
}
}
开发者ID:jypeitao,项目名称:opengl_learn,代码行数:16,代码来源:drawCircle.c
示例13: ofSetCircleResolution
void Particle::drawCircle(float x, float y, float diam) {
//center circles
ofSetCircleResolution(100);
ofNoFill();
ofDrawCircle(x,y,diam,diam);
diam = diam*.7;
if(diam>1){
drawCircle(x,y,diam++);
}
}
开发者ID:kimm068,项目名称:of_miyeon,代码行数:16,代码来源:Particle.cpp
示例14: CC_NODE_DRAW_SETUP
void Joystick::draw()
{
if (_simpleDrawEnabled) {
CC_NODE_DRAW_SETUP();
switch (_state) {
case jsTouched:
drawCircle();
break;
case jsTouchMoved:
drawArrow();
break;
default:
break;
}
}
}
开发者ID:fispurring,项目名称:Erratic,代码行数:16,代码来源:Joystick.cpp
示例15: glLoadIdentity
void Enemy::render(){
glLoadIdentity();
glColor3f(0,1,0);
switch(shape){
case S_CIRCLE:
drawCircle(x,y,size,40,2,0,fill);
break;
case S_RECT:
drawRectangle(x,y,size*2,size*2,angle,fill);
break;
case S_SMILEY:
drawSmileyFace(x,y,size);
break;
}
}
开发者ID:smrutled,项目名称:CSE-Opengl-Projects,代码行数:16,代码来源:Enemy.cpp
示例16: onDisplay
// Rajzolas, ha az alkalmazas ablak ervenytelenne valik, akkor ez a fuggveny hivodik meg
void onDisplay( ) {
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // torlesi szin beallitasa
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // kepernyo torles
if (contpoints.amount != 0) {
glColor3f(1.0f, 1.0f, 1.0f);
for (int i = 0; i < contpoints.amount; i++) {
drawFilledCircle(contpoints.points[i].x,contpoints.points[i].y,0.04f);
drawCircle(contpoints.points[i].x,contpoints.points[i].y,0.04f);
}
drawCatmullRom(contpoints);
}
glutSwapBuffers(); // Buffercsere: rajzolas vege
}
开发者ID:ptrsz,项目名称:graf1,代码行数:17,代码来源:main.cpp
示例17: onDrawContent
virtual void onDrawContent(SkCanvas* canvas) {
drawSomething(canvas);
SkPicture* pict = new SkPicture;
SkAutoUnref aur(pict);
drawSomething(pict->beginRecording(100, 100));
pict->endRecording();
canvas->save();
canvas->translate(SkIntToScalar(300), SkIntToScalar(50));
canvas->scale(-SK_Scalar1, -SK_Scalar1);
canvas->translate(-SkIntToScalar(100), -SkIntToScalar(50));
canvas->drawPicture(*pict);
canvas->restore();
canvas->save();
canvas->translate(SkIntToScalar(200), SkIntToScalar(150));
canvas->scale(SK_Scalar1, -SK_Scalar1);
canvas->translate(0, -SkIntToScalar(50));
canvas->drawPicture(*pict);
canvas->restore();
canvas->save();
canvas->translate(SkIntToScalar(100), SkIntToScalar(100));
canvas->scale(-SK_Scalar1, SK_Scalar1);
canvas->translate(-SkIntToScalar(100), 0);
canvas->drawPicture(*pict);
canvas->restore();
#ifdef SK_DEVELOPER
if (false) {
SkDebugfDumper dumper;
SkDumpCanvas dumpCanvas(&dumper);
dumpCanvas.drawPicture(*pict);
}
#endif
// test that we can re-record a subpicture, and see the results
SkMWCRandom rand(SampleCode::GetAnimTime());
canvas->translate(SkIntToScalar(10), SkIntToScalar(250));
drawCircle(fSubPicture->beginRecording(50, 50), 25,
rand.nextU() | 0xFF000000);
canvas->drawPicture(*fPicture);
delayInval(500);
}
开发者ID:andreicoman11,项目名称:OsmAnd-external-skia,代码行数:47,代码来源:SamplePicture.cpp
示例18: displayCircle
void displayCircle(void){
const float CX = 80.;
const float CY = 60.;
const float R = 30;
// Clear all pixels with the specified clear color
glClear(GL_COLOR_BUFFER_BIT);
// draw the four points in four colors
glBegin(GL_LINE_STRIP);
glColor3f(0., 1., 0.);
drawCircle(CX, CY, R, 100);
glEnd();
// start flushing OpenGL calls to to display buffer
glFlush();
}
开发者ID:adamschoenemann,项目名称:CGP,代码行数:17,代码来源:drawing.c
示例19: suspensionDraw
static void suspensionDraw(Suspension* s)
{
Chassis* c = s->chassis;
const vec3* x = &c->pose.v[0].v3;
const vec3* y = &c->pose.v[1].v3;
const vec3* z = &c->pose.v[2].v3;
const vec3* chassisPos = &c->pose.v[3].v3;
float cx = chassisPos->x;
float cy = chassisPos->y;
float cz = chassisPos->z;
Wheel* w = s->wheel;
float wx = w->pos.x;
float wy = w->pos.y;
float wz = w->pos.z;
vec3 point;
vec3mtx43mulvec3(&point, &c->pose, &s->offset);
glColor4f(1,1,1,1);
drawCircle(point.x, point.y, 0.05f);
vec3 a, b;
vecaddscale(&a, &point, &w->wheelAxis, -0.13f);
vecaddscale(&b, &point, &w->wheelAxis, +0.13f);
glBegin(GL_LINES);
glVertex3f(a.x, a.y, 0.f);
glVertex3f(b.x, b.y, 0.f);
glEnd();
vec3 forwards = {w->wheelAxis.y, -w->wheelAxis.x, 0.f};
vecaddscale(&a, &point, &forwards, -0.34f);
vecaddscale(&b, &point, &forwards, +0.34f);
glBegin(GL_LINES);
glVertex3f(a.x, a.y, 0.f);
glVertex3f(b.x, b.y, 0.f);
glEnd();
vec3 wheelVel;
vecaddscale(&wheelVel, &w->pos, &w->vel, subDt);
glColor4f(0,0,1,1);
glBegin(GL_LINES);
glVertex3f(wx, wy, 0.f);
glVertex3f(wheelVel.x, wheelVel.y, 0.f);
glEnd();
}
开发者ID:geckobike,项目名称:otp2,代码行数:46,代码来源:main.cpp
示例20: drawKeepEupEScreen
// will be called with next end as the last begin
// match == on begin only, otherwise get double markings
void drawKeepEupEScreen(void)
{
DEBUGBOX("drawKeepEupEScreen","");
clearScreen();
drawRectangleSafe(14,24,50,50);
DEBUGBOX("drawKeepEupEScreen","b4rect");
// messes up &WinDrawLineF ptr setup somewhere here
drawRectangle(14,24,50,50,&WinDrawLineF);
DEBUGBOX("drawKeepEupEScreen","");
drawTriangle(90,34,70,&WinDrawLineF);
DEBUGBOX("drawKeepEupEScreen","");
drawDiamond(14,90,60,&WinDrawLineF);
DEBUGBOX("drawKeepEupEScreen","");
drawCircle(90+27,90+27,27+27,&WinDrawLineF);
DEBUGBOX("drawKeepEupEScreen","");
}
开发者ID:Gaoithe,项目名称:bgttoolbox,代码行数:19,代码来源:keepEupEGame.c
注:本文中的drawCircle函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论