当前位置: 首页>>代码示例>>Python>>正文


Python wx.BufferedDC方法代码示例

本文整理汇总了Python中wx.BufferedDC方法的典型用法代码示例。如果您正苦于以下问题:Python wx.BufferedDC方法的具体用法?Python wx.BufferedDC怎么用?Python wx.BufferedDC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wx的用法示例。


在下文中一共展示了wx.BufferedDC方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: UpdateDrawing

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BufferedDC [as 别名]
def UpdateDrawing(self):
        dc = wx.BufferedDC(wx.ClientDC(self), self._buffer)
        self.Draw(dc) 
开发者ID:lrq3000,项目名称:pyFileFixity,代码行数:5,代码来源:squaremap.py

示例2: update

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BufferedDC [as 别名]
def update(self, force=False):
        if not self.IsShown() and not force:
            return
        dc = wx.BufferedDC(wx.ClientDC(self), self.buffer)
        self.draw(dc, size = self.GetClientSize()) 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:7,代码来源:Bling.py

示例3: Plotting_Test

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BufferedDC [as 别名]
def Plotting_Test(self):

        #--------------------------------------------------------
        # Note:  We may need to save the window's bitmap in a
        #        buffer and refresh it on certain events.
        #        As it stands now, moving the cursor to another
        #        window causes window contents to be lost,
        #        even if we use the Freeze() method.
        #--------------------------------------------------------
        window = self.plot_window
        nx  = self.window_nx
        ny  = self.window_ny
        # win_buffer = self.plot_buffer
        win_buffer = wx.EmptyBitmap(nx,ny)
        #---------------------------------------------
        # Create a device context (don't store them)
        #---------------------------------------------
        dc = wx.BufferedDC(wx.ClientDC(window))
        ## dc = wx.BufferedDC(wx.ClientDC(window), win_buffer)
        ## dc = wx.ClientDC(window)  # (also works)
        ## dc = wx.WindowDC(window)  # (also works)
        pen   = wx.Pen("black", 2, wx.SOLID)
        brush = wx.Brush("white", wx.SOLID)  # (for filling in areas)
        dc.SetPen(pen)
        dc.SetBrush(brush)
        dc.SetBackground(brush)
        dc.Clear()
        #------------------------------------------
        dc.DrawRectangle(0,0,nx,ny)
        dc.DrawLine(0,0,nx,ny)
        dc.DrawCircle(nx/2,ny/2, nx/3)
        # print 'dc.GetSize() =', dc.GetSize()

        ## window.Freeze()   # (see also window.Thaw() )
        ## window.Disable()
        
    #   Plotting_Test()       
    #---------------------------------------------------------------- 
开发者ID:peckhams,项目名称:topoflow,代码行数:40,代码来源:Main_Dialog.py

示例4: UpdateDrawing

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BufferedDC [as 别名]
def UpdateDrawing(self, dummyEvent=None):
        deviceContext = wx.BufferedDC(wx.ClientDC(self), self.dcBuffer)
        self.Draw(deviceContext) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:5,代码来源:AnimatedWindow.py

示例5: SetDrawing

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BufferedDC [as 别名]
def SetDrawing(self, drawFunc, args):
        self.drawing = drawFunc
        d = GetMonitorDimensions()[self.displayNum]
        self.SetDimensions(d.x, d.y, d.width, d.height)
        self._buffer = wx.EmptyBitmap(d.width, d.height)
        dc = wx.BufferedDC(wx.ClientDC(self), self._buffer)
        self.drawing(dc, *args)
        #self.Refresh(eraseBackground=False)
        wx.Frame.Show(self, True)
        BringHwndToFront(self.GetHandle(), False)
        self.SetCursor(wx.StockCursor(wx.CURSOR_BLANK)) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:13,代码来源:__init__.py

示例6: RefreshView

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BufferedDC [as 别名]
def RefreshView(self):
        width, height = self.MessagePanel.GetClientSize()
        bitmap = wx.EmptyBitmap(width, height)
        dc = wx.BufferedDC(wx.ClientDC(self.MessagePanel), bitmap)
        dc.Clear()
        dc.BeginDrawing()

        if self.CurrentMessage is not None:

            dc.SetFont(self.Font)

            for button in self.LeftButtons + self.RightButtons:
                button.Draw(dc)

            message_idx = self.CurrentMessage
            message = self.LogMessages[message_idx]
            draw_date = True
            offset = 5
            while offset < height and message is not None:
                message.Draw(dc, offset, width, draw_date)
                offset += message.GetHeight(draw_date)

                previous_message, message_idx = self.GetPreviousMessage(message_idx)
                if previous_message is not None:
                    draw_date = message.Date != previous_message.Date
                message = previous_message

        dc.EndDrawing()

        self.MessageScrollBar.RefreshThumbPosition() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:32,代码来源:LogViewer.py

示例7: Update

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BufferedDC [as 别名]
def Update(self):
        """Causes the canvas to be updated."""

        dc = wx.BufferedDC(wx.ClientDC(self), self.buffer)
        if WX3:
            dc.BeginDrawing()
        dc.Clear()
        self.Draw(dc)
        if WX3:
            dc.EndDrawing() 
开发者ID:dials,项目名称:dials,代码行数:12,代码来源:pyslip.py

示例8: DrawViewer

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BufferedDC [as 别名]
def DrawViewer(self):
        """
        Redraw content displayed by Viewer
        """
        # Create buffered DC for drawing in panel
        width, height = self.GetSize()
        bitmap = wx.EmptyBitmap(width, height)
        dc = wx.BufferedDC(wx.ClientDC(self), bitmap)
        dc.Clear()

        # Get Graphics Context for DC, for anti-aliased and transparent
        # rendering
        gc = wx.GCDC(dc)

        gc.BeginDrawing()

        # Get first item
        item = self.ItemsDict.values()[0]

        # Get item variable path masked according Debug Variable Panel mask
        item_path = item.GetVariable(
            self.ParentWindow.GetVariableNameMask())

        # Draw item variable path at Viewer left side
        w, h = gc.GetTextExtent(item_path)
        gc.DrawText(item_path, 20, (height - h) // 2)

        # Update 'Release' button state and text color according to item forced
        # flag value
        item_forced = item.IsForced()
        self.Buttons[1].Enable(item_forced)
        self.RefreshButtonsPosition()
        if item_forced:
            gc.SetTextForeground(wx.BLUE)

        # Draw item current value at right side of Viewer
        item_value = item.GetValue()
        w, h = gc.GetTextExtent(item_value)
        gc.DrawText(item_value, width - 40 - w, (height - h) // 2)

        # Draw other Viewer common elements
        self.DrawCommonElements(gc)

        gc.EndDrawing() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:46,代码来源:DebugVariableTextViewer.py


注:本文中的wx.BufferedDC方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。