
- Returns the source image size.
Return Type:
- integer list [ width, height ]
- pixel width of the source image
- Type: integer
- pixel height of the source image.
- Type: integer
- Video Texture width and height should be a power of 2.
- If the Video Texture is not a power of 2, the graphics pipeline automatically rescales the texture to a power of 2.
- 2 x 2
- 4 x 4
- 8 x 8
- 16 x 16
- 32 x 32
- 64 x 64
- 128 x 128
- 256 x 256
- 512 x 512
- etc
- And any combination. 128 x 512 is a power of 2.
- A texture of 300 x 300 will be automatically rescaled by the graphics pipeline to 512 x 512.
- A texture of 130 x 520 will be automatically rescaled by the graphics pipeline to 256 x 1024.

###################### get the source image size
# import bge module
import bge
# get current scene
scene = bge.logic.getCurrentScene()
# get a list of the cameras
camList = scene.cameras
# get camera being used for render to texture
# my camera is named Security_Cam
cam = camList["Security_Cam"]
# get list of objects in scene
objList = scene.objects
# get object to render to
# my object is named SecurityMonitor
obj = objList["SecurityMonitor"]
# get the SecurityMonitor material ID
# Name of my render material is Screen
matID = bge.texture.materialID(obj, "MAScreen")
# set the texture
renderToTexture = bge.texture.Texture(obj, matID)
# get the texture image
renderToTexture.source = bge.texture.ImageRender(scene,cam)
# get image size
image_size = renderToTexture.source.size
# save RenderToTexture as an object variable
obj["Render"] = renderToTexture
# update the texture
renderToTexture.refresh(True)