當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.BITMAP_TYPE_BMP屬性代碼示例

本文整理匯總了Python中wx.BITMAP_TYPE_BMP屬性的典型用法代碼示例。如果您正苦於以下問題:Python wx.BITMAP_TYPE_BMP屬性的具體用法?Python wx.BITMAP_TYPE_BMP怎麽用?Python wx.BITMAP_TYPE_BMP使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在wx的用法示例。


在下文中一共展示了wx.BITMAP_TYPE_BMP屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: print_bmp

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import BITMAP_TYPE_BMP [as 別名]
def print_bmp(self, filename, *args, **kwargs):
        return self._print_image(filename, wx.BITMAP_TYPE_BMP, *args, **kwargs) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:4,代碼來源:backend_wx.py

示例2: __call__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import BITMAP_TYPE_BMP [as 別名]
def __call__(self, imageFileName='', style=1):
        if imageFileName:
            image = wx.Image(imageFileName)
            imageFileName = os.path.join(
                eg.folderPath.RoamingAppData, "Microsoft", "Wallpaper1.bmp"
            )
            image.SaveFile(imageFileName, wx.BITMAP_TYPE_BMP)
        tile, wstyle = (("0", "0"), ("1", "0"), ("0", "2"))[style]
        hKey = _winreg.CreateKey(
            _winreg.HKEY_CURRENT_USER,
            "Control Panel\\Desktop"
        )
        _winreg.SetValueEx(
            hKey,
            "TileWallpaper",
            0,
            _winreg.REG_SZ,
            tile
        )
        _winreg.SetValueEx(
            hKey,
            "WallpaperStyle",
            0,
            _winreg.REG_SZ,
            wstyle
        )
        _winreg.CloseKey(hKey)
        res = SystemParametersInfo(
            SPI_SETDESKWALLPAPER,
            0,
            create_unicode_buffer(imageFileName),
            SPIF_SENDCHANGE | SPIF_UPDATEINIFILE
        )
        if res == 0:
            self.PrintError(ctypes.FormatError()) 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:37,代碼來源:__init__.py

示例3: Get_Navigation_Panel

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import BITMAP_TYPE_BMP [as 別名]
def Get_Navigation_Panel(self):

        #----------------------------------
        # Create a new panel with a sizer
        #----------------------------------
        panel = wx.Panel(self)
        panel.SetBackgroundColour('Light Blue')
        self.navigation_panel = panel
        sizer = wx.GridSizer(2, 2, self.hgap, self.vgap)
        panel.SetSizer(sizer)
        
        #-----------------------------------
        # Can we find the button bitmaps ?
        #-----------------------------------
        
        #-------------------------
        # Get the button bitmaps
        #-------------------------
        bmp_nx    = 168
        bmp_ny    = 128
        bmp_file1 = self.bmp_dir + "TF_Button1.bmp"
        bmp_file2 = self.bmp_dir + "TF_Button2.bmp"
        bmp_file3 = self.bmp_dir + "TF_Button3.bmp"
        bmp_file4 = self.bmp_dir + "TF_Button4.bmp"
        bmp1 = wx.Image(bmp_file1, wx.BITMAP_TYPE_BMP).ConvertToBitmap()
        bmp2 = wx.Image(bmp_file2, wx.BITMAP_TYPE_BMP).ConvertToBitmap()
        bmp3 = wx.Image(bmp_file3, wx.BITMAP_TYPE_BMP).ConvertToBitmap()
        bmp4 = wx.Image(bmp_file4, wx.BITMAP_TYPE_BMP).ConvertToBitmap()
        #-----------------------------------------------------------------
        new_button  = wx.BitmapButton(panel, -1, bmp1)
        pre_button  = wx.BitmapButton(panel, -1, bmp2)
        plot_button = wx.BitmapButton(panel, -1, bmp3)
        exit_button = wx.BitmapButton(panel, -1, bmp4)
        #-----------------------------------------------------------------
        proportion = 0
        flag   = wx.ALIGN_CENTER  # (affects resizing by user)
        border = 10
        sizer.Add(new_button,  proportion, flag, border)
        sizer.Add(pre_button,  proportion, flag, border)
        sizer.Add(plot_button, proportion, flag, border)
        sizer.Add(exit_button, proportion, flag, border)
        #------------------------------------------------------------------
        self.Bind(wx.EVT_BUTTON, self.On_Goto_New_Run,       new_button)
        self.Bind(wx.EVT_BUTTON, self.On_Goto_Preprocessing, pre_button)
        self.Bind(wx.EVT_BUTTON, self.On_Goto_Plotting,      plot_button)
        self.Bind(wx.EVT_BUTTON, self.On_File_Exit,          exit_button)

        #------------------------------------
        # Main panel is displayed at start,
        # but other panels are hidden
        #------------------------------------
        sizer.Fit(self)
        panel.Show()
        ## sizer.Show(True)    # (also works)
        
    #   Get_Navigation_Panel()
    #---------------------------------------------------------------- 
開發者ID:peckhams,項目名稱:topoflow,代碼行數:59,代碼來源:Main_Dialog_OLD.py

示例4: Add_Navigation_Panel

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import BITMAP_TYPE_BMP [as 別名]
def Add_Navigation_Panel(self):

        #----------------------------------
        # Create a new panel with a sizer
        #----------------------------------
        panel = self.main_panel
        hgap  = 20
        vgap  = 15
        sizer = wx.GridSizer(2, 2, hgap, vgap)
        self.navigation_sizer = sizer
        
        #-----------------------------------
        # Can we find the button bitmaps ?
        #-----------------------------------
        
        #-------------------------
        # Get the button bitmaps
        #-------------------------
        bmp_nx    = 168
        bmp_ny    = 128
        bmp_file1 = self.bmp_dir + "TF_Button1.bmp"
        bmp_file2 = self.bmp_dir + "TF_Button2.bmp"
        bmp_file3 = self.bmp_dir + "TF_Button3.bmp"
        bmp_file4 = self.bmp_dir + "TF_Button4.bmp"
        bmp1 = wx.Image(bmp_file1, wx.BITMAP_TYPE_BMP).ConvertToBitmap()
        bmp2 = wx.Image(bmp_file2, wx.BITMAP_TYPE_BMP).ConvertToBitmap()
        bmp3 = wx.Image(bmp_file3, wx.BITMAP_TYPE_BMP).ConvertToBitmap()
        bmp4 = wx.Image(bmp_file4, wx.BITMAP_TYPE_BMP).ConvertToBitmap()
        #-----------------------------------------------------------------
        new_button  = wx.BitmapButton(panel, -1, bmp1)
        pre_button  = wx.BitmapButton(panel, -1, bmp2)
        plot_button = wx.BitmapButton(panel, -1, bmp3)
        exit_button = wx.BitmapButton(panel, -1, bmp4)
        #-----------------------------------------------------------------
        proportion = 0
        # flag   = wx.ALIGN_CENTER  # (affects resizing by user)
        flag   = wx.ALL
        border = 20
        sizer.Add(new_button,  proportion, flag, border)
        sizer.Add(pre_button,  proportion, flag, border)
        sizer.Add(plot_button, proportion, flag, border)
        sizer.Add(exit_button, proportion, flag, border)
        #------------------------------------------------------------------
        self.Bind(wx.EVT_BUTTON, self.On_Goto_Run_Info,      new_button)
        self.Bind(wx.EVT_BUTTON, self.On_Goto_Preprocessing, pre_button)
        self.Bind(wx.EVT_BUTTON, self.On_Goto_Plotting,      plot_button)
        self.Bind(wx.EVT_BUTTON, self.On_File_Exit,          exit_button)

        #---------------------------------------
        # Add run_info_sizer to the main_sizer
        #---------------------------------------
        self.main_sizer.Add(sizer, 0, wx.ALL, self.vgap)
        self.main_sizer.Hide(sizer)
        
    #   Add_Navigation_Panel()
    #---------------------------------------------------------------- 
開發者ID:peckhams,項目名稱:topoflow,代碼行數:58,代碼來源:Main_Dialog.py


注:本文中的wx.BITMAP_TYPE_BMP屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。