Exemple #1
0
 def testResize():
     srcBmp = avg.Bitmap('media/rgb24-32x32.png')
     destBmp = srcBmp.getResized((64,64))
     self.assert_(destBmp.getSize() == (64,64))
     node = avg.ImageNode(pos=(128,0), size=(32,32), parent=root)
     node.setBitmap(destBmp)
Exemple #2
0
 def testCropRect():
     bmp = avg.Bitmap('media/rgb24-65x65.png')
     bmp1 = avg.Bitmap(bmp, (32,32), (64,64))
     self.assert_(bmp1.getSize() == (32,32))
     node = avg.ImageNode(pos=(96,0), parent=root)
     node.setBitmap(bmp1)
Exemple #3
0
 def loadBitmap():
     bmp = avg.Bitmap("media/colorramp.png")
     self.image.setBitmap(bmp)
Exemple #4
0
 def testStringConversion():
     bmp = avg.Bitmap('media/rgb24-65x65.png')
     s = bmp.getPixels()
     bmp1 = avg.Bitmap(bmp.getSize(), bmp.getFormat(), "sample")
     bmp1.setPixels(s)
     self.assert_(self.areSimilarBmps(bmp, bmp1, 0.01, 0.01))
Exemple #5
0
 def setFillBitmap():
     bmp = avg.Bitmap("media/rgb24-64x64.png")
     self.rect.setFillBitmap(bmp)
Exemple #6
0
 def bmpTexture():
     bmp = avg.Bitmap("media/rgb24alpha-64x64.png")
     self.line.setBitmap(bmp)