c++imagefunctiontransparencyopenframeworks

Set transparency of an image on openFrameworks


I'm working on openFrameworks and I want to set the transparency of an image in order to modify it when I press a button, but I don't know how to implement this parameter.

In which way can I change this value? Is there a particular function to manage the transparency of an image?


Solution

  • check out http://openframeworks.cc/ofBook/chapters/intro_to_graphics.html

    ofEnableAlphaBlending();
    ofSetColor(255,0,0,127); # this would be a 50% transparent red color
    ofDrawRectangle(20,20,100,100);
    ofDisableAlphaBlending();