Added ImageExporter error message for zero-size export
This commit is contained in:
parent
d8f9fb0781
commit
54ca31f91b
@ -64,6 +64,9 @@ class ImageExporter(Exporter):
|
||||
|
||||
#self.png = QtGui.QImage(targetRect.size(), QtGui.QImage.Format_ARGB32)
|
||||
#self.png.fill(pyqtgraph.mkColor(self.params['background']))
|
||||
w, h = self.params['width'], self.params['height']
|
||||
if w == 0 or h == 0:
|
||||
raise Exception("Cannot export image with size=0 (requested export size is %dx%d)" % (w,h))
|
||||
bg = np.empty((self.params['width'], self.params['height'], 4), dtype=np.ubyte)
|
||||
color = self.params['background']
|
||||
bg[:,:,0] = color.blue()
|
||||
|
Loading…
Reference in New Issue
Block a user