Quantcast
Viewing all articles
Browse latest Browse all 40524

Draw circles on mouse postion over image

Correct me if i'm wrong.. I understand you want to draw circles over a jpg image you have? And you want to draw the circles in the mouse position when you click? Like a Paint application?

If you want to draw continuous circles (paint-like), then you will need to draw onto an ofFbo and draw it on top of the jpg image ( comment if you need more advice on how to do this )

Maybe what you want is to show a circle when you press ( and hide it when not pressing ), then its quite simple:

ofApp::draw()
{
    ofClear(0);
    // draw image
    image.draw(0,0);
    // if the mouse is being pressed
    if(ofGetMousePressed())
    {
        // draw circle at (mouseX, mouseY)
        ofCircle(mouseX, mouseY, 100);
    }
}

Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>