I’m trying to use the .grabScreen to save the screen view into an image file for export. Using Openframeworks on Visual Studio 17.
I get a crash when the dimensions of the grab are 1675 x 950, which seem pretty small to me - what would be causing this? Is there any way to avoid it?
alternatively, is there a way to draw to an fbo using a 3d camera? (for later porting to pixels/ofImage export)
I am attempting the following, but the fbo seems to come out empty. Am I doing something wrong? (tD_GraphCam is an easyCam object)
ofSetColor(255, 0, 0);
ofRectangle outputsize(0, 0, V_width, V_height);
ofBeginSaveScreenAsPDF(saveTiffResult.filePath, false, false, outputsize);
pdf rendering doesn’t allow textures since textures are an opengl concept that the pdf renderer doesn’t know anything about you need to download the texture to pixels first to be able to draw it.
The crash could be cause you are using a different format to download than the one the texture is in, usually one that is bigger, like the texture is rgb but you are downloading as rgba.
Also sometimes textures with weird sizes might have a padding to make the size something that the graphics card supports, so downloading it would try to download a bigger size. I’ve never seen this in opengl but perhaps try allocating a bigger texture with a more standard size even if you then only use 1675x950
Aaaah, interesting on the format front. Might be it…
On the Fbo pdf export issue I’ve just done:
and then draw img in the pdf draw - this solves it.
Hopefully this approach will fix my crash anyway, have replaced the grab screen functions all the way through now…