本文整理汇总了Python中Resources.getHand16Image方法的典型用法代码示例。如果您正苦于以下问题:Python Resources.getHand16Image方法的具体用法?Python Resources.getHand16Image怎么用?Python Resources.getHand16Image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Resources
的用法示例。
在下文中一共展示了Resources.getHand16Image方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import getHand16Image [as 别名]
def __init__(self):
if "wxMac" in wx.PlatformInfo: # use 16X16 cursors for wxMac
self.HandCursor = wx.CursorFromImage(Resources.getHand16Image())
self.GrabHandCursor = wx.CursorFromImage(Resources.getGrabHand16Image())
img = Resources.getMagPlus16Image()
img.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 6)
img.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 6)
self.MagPlusCursor = wx.CursorFromImage(img)
img = Resources.getMagMinus16Image()
img.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 6)
img.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 6)
self.MagMinusCursor = wx.CursorFromImage(img)
else: # use 24X24 cursors for GTK and Windows
self.HandCursor = wx.CursorFromImage(Resources.getHandImage())
self.GrabHandCursor = wx.CursorFromImage(Resources.getGrabHandImage())
img = Resources.getMagPlusImage()
img.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 9)
img.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 9)
self.MagPlusCursor = wx.CursorFromImage(img)
img = Resources.getMagMinusImage()
img.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 9)
img.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 9)
self.MagMinusCursor = wx.CursorFromImage(img)
示例2:
# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import getHand16Image [as 别名]
Note that this can only be imported after a wx.App() has been created.
This approach was inpired by Christian Blouin, who also wrote the initial
version of the code.
"""
import wx
## fixme: events should live in their own module, so all of FloatCanvas
## wouldn't have to be imported here.
import FloatCanvas, Resources
import numpy as N
## create all the Cursors, so they don't need to be created each time.
if "wxMac" in wx.PlatformInfo: # use 16X16 cursors for wxMac
HandCursor = wx.CursorFromImage(Resources.getHand16Image())
GrabHandCursor = wx.CursorFromImage(Resources.getGrabHand16Image())
img = Resources.getMagPlus16Image()
img.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 6)
img.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 6)
MagPlusCursor = wx.CursorFromImage(img)
img = Resources.getMagMinus16Image()
img.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 6)
img.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 6)
MagMinusCursor = wx.CursorFromImage(img)
else: # use 24X24 cursors for GTK and Windows
HandCursor = wx.CursorFromImage(Resources.getHandImage())
GrabHandCursor = wx.CursorFromImage(Resources.getGrabHandImage())