Beispiel #1
0
 def testSvgAnnotationInLayout(self):
     """ test rendering a svg annotation"""
     a = QgsSvgAnnotation()
     a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
     a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
     a.setFrameSizeMm(QSizeF(300 / 3.7795275, 200 / 3.7795275))
     a.setFrameOffsetFromReferencePointMm(QPointF(40 / 3.7795275, 50 / 3.7795275))
     svg = TEST_DATA_DIR + "/sample_svg.svg"
     a.setFilePath(svg)
     self.assertTrue(self.renderAnnotationInLayout('svg_annotation_in_layout', a))
Beispiel #2
0
 def testSvgAnnotationInLayout(self):
     """ test rendering a svg annotation"""
     a = QgsSvgAnnotation()
     a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
     a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
     a.setFrameSizeMm(QSizeF(300 / 3.7795275, 200 / 3.7795275))
     a.setFrameOffsetFromReferencePointMm(QPointF(40 / 3.7795275, 50 / 3.7795275))
     svg = TEST_DATA_DIR + "/sample_svg.svg"
     a.setFilePath(svg)
     self.assertTrue(self.renderAnnotationInLayout('svg_annotation_in_layout', a))
Beispiel #3
0
    def testSvgAnnotation(self):
        """ test rendering a svg annotation"""
        a = QgsSvgAnnotation()
        a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
        a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
        a.setFrameSizeMm(QSizeF(300 / 3.7795275, 200 / 3.7795275))
        a.setFrameOffsetFromReferencePointMm(QPointF(40 / 3.7795275, 50 / 3.7795275))
        svg = TEST_DATA_DIR + "/sample_svg.svg"
        a.setFilePath(svg)
        im = self.renderAnnotation(a, QPointF(20, 30))
        self.assertTrue(self.imageCheck('svg_annotation', 'svg_annotation', im))

        # check clone
        clone = a.clone()
        im = self.renderAnnotation(clone, QPointF(20, 30))
        self.assertTrue(self.imageCheck('svg_annotation', 'svg_annotation', im))
Beispiel #4
0
    def testSvgAnnotation(self):
        """ test rendering a svg annotation"""
        a = QgsSvgAnnotation()
        a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
        a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
        a.setFrameSizeMm(QSizeF(300 / 3.7795275, 200 / 3.7795275))
        a.setFrameOffsetFromReferencePointMm(QPointF(40 / 3.7795275, 50 / 3.7795275))
        svg = TEST_DATA_DIR + "/sample_svg.svg"
        a.setFilePath(svg)
        im = self.renderAnnotation(a, QPointF(20, 30))
        self.assertTrue(self.imageCheck('svg_annotation', 'svg_annotation', im))

        # check clone
        clone = a.clone()
        im = self.renderAnnotation(clone, QPointF(20, 30))
        self.assertTrue(self.imageCheck('svg_annotation', 'svg_annotation', im))