Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

Create a transparent PNG from textbuffer

$
0
0

exactly what hahakid said but just a note that when you clear, clear with ofClear(255,255,255,0) -- ie, clear with full transparency, ie:

fbo.begin();
ofClear(255,255,255,0);
fbo.end();

note that whatever color you clear with if you draw text that has alpha (most fonts have some alpha on the edges) it will blend with that color. So, if you clear the background with white and full alpha, and draw black text, you'll see a white halo around the black text.

I don't know if there's a faster way, but I usually do this to read out the fbo and save it to an image:

ofPixels temp;
fbo.readToPixels(temp);
ofSaveImage("myImage.png", temp);

Viewing all articles
Browse latest Browse all 40524

Trending Articles



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