Logo Search packages:      
Sourcecode: eikazo version File versions  Download package

def Eikazo::Preview::_SanePreview::draw_scanwindow (   self  ) 

draw a rectangle for the currently selected scan window.

Definition at line 330 of file Preview.py.

00330                              :
        """ draw a rectangle for the currently selected scan window.
        """
        gc = self.style.white_gc
        # take the settigs directly from the device. This way,
        # we always get a precise display
        xmin, xmax, ymin, ymax = self.device.getMaxScanArea()
        w,h = tuple(self.get_allocation())[2:]
        scalex = float(w)/(xmax-xmin)
        scaley = float(h)/(ymax-ymin)
        device = self.device
        tlx = device.tl_x * scalex
        brx = device.br_x * scalex
        tly = device.tl_y * scaley
        bry = device.br_y * scaley

        w = int(brx - tlx)
        h = int(bry - tly)
        tlx = int(tlx)
        tly = int(tly)
        # scan window corners in display pixel units
        self.lastwindow = (tlx, tlx + w, tly, tly + w)
        gc.set_line_attributes(1, gtk.gdk.LINE_DOUBLE_DASH, 
                               gtk.gdk.CAP_BUTT, gtk.gdk.JOIN_MITER)
        device = device._device
        self.window.draw_rectangle(gc, False, tlx, tly, w, h)
        
    
    def setImage(self, image, scanwindow):


Generated by  Doxygen 1.6.0   Back to index