Images can now be embedded in Python source files.

Added tools to do the embedding.
Added Constructors/methods where needed.
Updated the demo to use mostly embedded images.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-04-09 19:36:36 +00:00
parent 28af3deb9f
commit 96bfd05319
50 changed files with 6077 additions and 156 deletions

View File

@@ -1,6 +1,8 @@
from wxPython.wx import *
import images
#----------------------------------------------------------------------
class DragShape:
@@ -47,14 +49,14 @@ class DragCanvas(wxScrolledWindow):
self.dragShape = None
self.SetCursor(wxStockCursor(wxCURSOR_ARROW))
self.bg_bmp = wxBitmap('bitmaps/backgrnd.png', wxBITMAP_TYPE_PNG)
self.bg_bmp = images.getBackgroundBitmap()
# Make a shape from an image and mask. This one will demo
# dragging outside the window
bmp = wxBitmap('bitmaps/test_image.png', wxBITMAP_TYPE_PNG)
mask = wxMaskColour(bmp, wxWHITE)
bmp.SetMask(mask)
bmp = images.getTestStarBitmap()
#mask = wxMaskColour(bmp, wxWHITE)
#bmp.SetMask(mask)
shape = DragShape(bmp)
shape.pos = wxPoint(5, 5)
shape.fullscreen = true
@@ -84,8 +86,9 @@ class DragCanvas(wxScrolledWindow):
# Make some shapes from some playing card images.
x = 200
for card in ['01c.gif', '10s.gif', '12h.gif', '13d.gif']:
bmp = wxBitmap('bitmaps/'+card, wxBITMAP_TYPE_GIF)
for card in ['_01c_', '_12h_', '_13d_', '_10s_']:
bmpFunc = getattr(images, "get%sBitmap" % card)
bmp = bmpFunc()
shape = DragShape(bmp)
shape.pos = wxPoint(x, 5)
self.shapes.append(shape)