mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-09-05 01:10:12 +02:00
* Tweak six a little, adding its license text since we'll only be distributing the module, fix the name of the dummy moves module, and add a PY33 constant since the change in memoryview affects our code. * Update all modules already using the old wx2to3 * Tweak lots of unit tests and other modules to work with Python 3.3 (still a few more that will need some work.) * Try to deal with memoryview changes in Py3.3, without much luck... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73195 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
37 lines
967 B
Python
37 lines
967 B
Python
import imp_unittest, unittest
|
|
import wtc
|
|
import wx
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
class rawbmp_Tests(wtc.WidgetTestCase):
|
|
|
|
def test_rawbmp1(self):
|
|
DIM = 100
|
|
red = 10
|
|
green = 20
|
|
blue = 30
|
|
alpha = 128
|
|
|
|
bmp = wx.Bitmap(DIM, DIM, 32)
|
|
pixelData = wx.AlphaPixelData(bmp)
|
|
self.assertTrue(pixelData)
|
|
|
|
# Test using the __iter__ generator
|
|
for pixel in pixelData:
|
|
pixel.Set(red, green, blue, alpha)
|
|
|
|
# This block of code is another way to do the same as above
|
|
pixels = pixelData.GetPixels()
|
|
for y in range(DIM):
|
|
pixels.MoveTo(pixelData, 0, y)
|
|
for x in range(DIM):
|
|
pixels.Set(red, green, blue, alpha)
|
|
pixels.nextPixel()
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|