【问题标题】:In Wxpython How do i Insert an image into an Ultimatelistctrl column?在 Wxpython 中,如何将图像插入 Ultimatelistctrl 列?
【发布时间】:2013-02-10 02:17:58
【问题描述】:

我很好奇如何将图像从特定目录插入到 Ultimatelistctrl 中的特定行/列中

MainFrame.ultimatelist = ULC.UltimateListCtrl( self.panel , agwStyle = wx.LC_REPORT | wx.LC_VRULES | wx.LC_HRULES , pos = (10,100) , size = (1240 , 520) )
    #-------------------------------------------------------------
    MainFrame.FirstColumn = ULC.UltimateListItem()
    MainFrame.FirstColumn._mask = wx.LIST_MASK_TEXT | wx.LIST_MASK_IMAGE | wx.LIST_MASK_FORMAT | ULC.ULC_MASK_CHECK
    MainFrame.FirstColumn._image = []
    MainFrame.FirstColumn._format = 1
    MainFrame.FirstColumn._kind = 1
    MainFrame.FirstColumn._text = ""
    MainFrame.ultimatelist.InsertColumnInfo( 1 , MainFrame.FirstColumn)
    MainFrame.arrowicon = wx.Image( "arrow.jpg" , wx.BITMAP_TYPE_ANY).ConvertToBitmap()


    MainFrame.ultimatelist.SetImage( 0 , MainFrame.arrowicon )

干杯,这真的很困扰我:)

【问题讨论】:

    标签: image list insert wxpython controls


    【解决方案1】:

    所有的魔法都在 wxPython 演示中。您需要创建一个 UltimateListCtrl.PyImageList。然后向其中添加 wx.Bitmap 实例。接下来,您需要告诉 UltimateListItem() 对象使用图像列表中的项目。在演示中,查找“info._image”以查看它是如何完成的。您可以从 wxPython 网站下载 wxPython 演示。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-20
      • 2020-12-26
      • 1970-01-01
      相关资源
      最近更新 更多