Image Module 
To load an image 
in  PNG,JPG,TGA or BMP format
    Début   Index
precedentScript Dimension and  distance
Under construction Next

To download the script

# ==================================
# Load  a  jpg/png/tga/bmp image v.0.2
# with the new functions of the Blender python Image module

# jmsoler, 29/10/2004
# ==================================
import Blender
from Blender import BGL



def Display_Image(img,x,y,dx,dy): 
 img =  objetc loaded with Blender.Image.Load() function
 x,y =   location in the script window from the left bottom corner
 dx,dy = scaling the image size dx for width and dy for height
 BGL.glBindTexture(BGL.GL_TEXTURE_2D, img.getBindCode())
 BGL.glVertex3f(float(x),float(y+img.getSize()[1]*dy),0.0 )


def draw():
 global img
 size= BGL.Buffer(BGL.GL_FLOAT, 4)
 BGL.glGetFloatv(BGL.GL_SCISSOR_BOX, size) 
 size= size.list

 # Example 1, backgrounded image
 # sized to the script window

 #example 2, scaled image

 #example 3, slized by the right-top corner of the windows

 #example 4, normal sized image at the top of the pile

 Blender.Draw.Button("Exit", 1, 100, 10, 80, 19)

def event(evt, val): 
 global img
 if (evt== Blender.Draw.QKEY and not val): 

def bevent(evt):
 if   (evt== 1): Blender.Draw.Exit()

Blender.Draw.Register(draw, event, bevent)

précédentScript Dimension et  distance
 Under construction Suivant
To  the top of the page

For questions,  the forum  :