Changeset 929


Ignore:
Timestamp:
04/09/13 17:27:34 (6 years ago)
Author:
marcus
Message:
  • implements HC
Location:
SHX/trunk/SeismicHandler
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/modules/wx_.py

    r906 r929  
    5151        self.refresh = False 
    5252        self.AllowDoubleClick = True 
     53        self.do_screenshot = False 
    5354 
    5455        # temporary layer for mouse motion 
     
    913914        x, y = self.CalcUnscrolledPosition(0, 0) 
    914915        dc2.Blit(0, 0, width, height, canvas, x, y) 
     916        if self.do_screenshot: 
     917            self.save_shot(canvas) 
     918            self.do_screenshot = False 
     919        # detach 
     920        canvas.SelectObject(wx.NullBitmap) 
     921 
     922    def save_shot(self, dc): 
     923        """ 
     924        Save PNG screen shot (PS later) 
     925        """ 
     926        size = dc.Size 
     927 
     928        shot = wx.EmptyBitmap(size.width, size.height) 
     929        shot_dc = wx.MemoryDC() 
     930        shot_dc.SelectObject(shot) 
     931 
     932        shot_dc.Blit(0, 0, size.width, size.height, dc, 0, 0) 
     933        shot_dc.SelectObject(wx.NullBitmap) 
     934        img = shot.ConvertToImage() 
     935        img.SaveFile(self.do_screenshot, wx.BITMAP_TYPE_PNG) 
     936        log_message("info", "screen dump saved in: %s" % self.do_screenshot) 
    915937 
    916938    @staticmethod 
     
    10481070    return plotter._user_selection 
    10491071subscribe_ui_event(__select_gui, "input") 
     1072 
     1073 
     1074@ui_events 
     1075def __screenshot(fname): 
     1076    """ 
     1077    Trigger screen shot creation. Thread-safe. Image will be saved immediately. 
     1078    """ 
     1079    global plotter 
     1080    plotter.canvas.do_screenshot = fname 
     1081    plotter.canvas.refresh = True 
     1082    wx.CallAfter(plotter.canvas.OnIdle, None) 
     1083subscribe_ui_event(__screenshot, "screenshot") 
  • SHX/trunk/SeismicHandler/shx.conf

    r927 r929  
    3535# cache for fetch command 
    3636cache = [PRIVATE]/sds/ 
     37# scratch 
     38scratch = [PRIVATE]/scratch 
    3739 
    3840[inventory] 
Note: See TracChangeset for help on using the changeset viewer.