Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 在Wxpython中,如何将图像插入到Ultimatelistctrl列中?_Image_List_Insert_Wxpython_Controls - Fatal编程技术网

Image 在Wxpython中,如何将图像插入到Ultimatelistctrl列中?

Image 在Wxpython中,如何将图像插入到Ultimatelistctrl列中?,image,list,insert,wxpython,controls,Image,List,Insert,Wxpython,Controls,我很好奇如何将特定目录中的图像插入到Ultimatelistctrl中的特定行/列中 MainFrame.ultimatelist = ULC.UltimateListCtrl( self.panel , agwStyle = wx.LC_REPORT | wx.LC_VRULES | wx.LC_HRULES , pos = (10,100) , size = (1240 , 520) ) #-----------------------------------------------

我很好奇如何将特定目录中的图像插入到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 )

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

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