hi,i create a deep buf,and want to save the image to file :
/************/
self.buffer = self.createOffscreenBuffer(-3,1024,1024)
self.depthmap = Texture()
self.buffer.addRenderTexture(self.depthmap, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPColor)
You can use base.screenshot(source = self.buffer), instead of iterating through all of the windows to find self.buffer. Or, just use self.buffer.saveScreenshot(), which is all that base.screenshot() does (you can see the code for base.screenshot() in ShowBase.py).
If you want to save out the image from the texture, instead of from the buffer, then you have to use RTPCopyRam (which is slower) instead of RTPBindOrCopy.
Since the image is smaller than you expect, perhaps you are actually getting a ParasiteBuffer, which is constrained to be no larger than the window size?