mirror of
https://github.com/grp/Wii.py.git
synced 2025-06-18 23:05:48 -04:00
TPL preview fixes for wx apps, RGBA8 is great *within* tpl.py but it fails on the wii :P
This commit is contained in:
parent
8d928288dc
commit
f5a8145c4b
17
TPL.py
17
TPL.py
@ -513,22 +513,21 @@ class TPL():
|
|||||||
|
|
||||||
Again, only a single texture is supported."""
|
Again, only a single texture is supported."""
|
||||||
import wx
|
import wx
|
||||||
class imp(wx.Panel):
|
class imp(wx.Dialog):
|
||||||
def __init__(self, parent, id, im):
|
def __init__(self, title, im):
|
||||||
wx.Panel.__init__(self, parent, id)
|
|
||||||
w = img.GetWidth()
|
w = img.GetWidth()
|
||||||
h = img.GetHeight()
|
h = img.GetHeight()
|
||||||
wx.StaticBitmap(self, -1, im, ( ((max(w, 300) - w) / 2), ((max(h, 200) - h) / 2) ), (w, h))
|
|
||||||
|
wx.Dialog.__init__(self, None, -1, title, size = (max(w, 300), max(h, 200)))
|
||||||
|
|
||||||
|
wx.StaticBitmap(self, -1, im, ( ((max(w, 300) - w) / 2), ((max(h, 200) - h) / 2) ), (w, h))
|
||||||
self.toImage("tmp.png")
|
self.toImage("tmp.png")
|
||||||
img = wx.Image("tmp.png", wx.BITMAP_TYPE_ANY).ConvertToBitmap()
|
img = wx.Image("tmp.png", wx.BITMAP_TYPE_ANY).ConvertToBitmap()
|
||||||
w = img.GetWidth()
|
w = img.GetWidth()
|
||||||
h = img.GetHeight()
|
h = img.GetHeight()
|
||||||
app = wx.App(redirect = False)
|
dialog = imp("TPL (" + str(w) + ", " + str(h) + ")", img)
|
||||||
frame = wx.Frame(None, -1, "TPL (" + str(w) + ", " + str(h) + ")", size = (max(w, 300), max(h, 200)))
|
dialog.ShowModal()
|
||||||
image = imp(frame, -1, img)
|
dialog.Destroy()
|
||||||
frame.Show(True)
|
|
||||||
app.MainLoop()
|
|
||||||
os.unlink("tmp.png")
|
os.unlink("tmp.png")
|
||||||
def RGBA8(self, (x, y), data):
|
def RGBA8(self, (x, y), data):
|
||||||
out = [0 for i in range(x * y)]
|
out = [0 for i in range(x * y)]
|
||||||
|
Loading…
Reference in New Issue
Block a user