我想在wxPython中创建一个简单的形状窗口.或多或少我想做wx相当于Tkinter的self.overrideredirect(1)(它摆脱了默认的操作系统寄存器),然后围绕窗口的角落.
在使用wxPython的Python中,如何根据鼠标相对于应用程序窗口或框架的接近程度来设置窗口的透明度和大小?
例如.类似于双曲线缩放,还是MAC OS X中的Dock?我试图用透明度和形状窗口的png实现这种效果.
任何执行此操作的库或代码片段都会很棒.谢谢.
我不知道是否可能.有什么方法可以将jframe的形状改成圆形
我已经将问题的原因分离为图像,因为代码似乎与其他具有透明度的png图像一起使用.但是,它似乎不适用于我需要它的一个图像.当我试图制作一个形状漂亮的窗户时,这将是非常有帮助的.
图片:
alt text http://i32.tinypic.com/f1xlj7.png
代码:
import wx
class PictureWindow(wx.Frame):
def __init__(self, parent, id, title, pic_location):
# For PNGs. Must be PNG-8 for transparency...
self.bmp = wx.Image(pic_location, wx.BITMAP_TYPE_PNG).ConvertToBitmap()
framesize = (self.bmp.GetWidth(), self.bmp.GetHeight())
# Launch a frame the size of our image. Note the position and style stuff...
# (Set pos to (-1, -1) to let the OS place it.
# This style wx.FRAME_SHAPED is a frameless plain window.
wx.Frame.__init__(self, parent, id, title, size=framesize, pos = (50, 50), style = wx.FRAME_SHAPED) …Run Code Online (Sandbox Code Playgroud) wxpython ×3
python ×2
java ×1
mouseevent ×1
png ×1
proximity ×1
swing ×1
translucency ×1
transparency ×1