本文整理汇总了Python中PyQt4.QtGui.QImageReader.height方法的典型用法代码示例。如果您正苦于以下问题:Python QImageReader.height方法的具体用法?Python QImageReader.height怎么用?Python QImageReader.height使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QImageReader
的用法示例。
在下文中一共展示了QImageReader.height方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write
# 需要导入模块: from PyQt4.QtGui import QImageReader [as 别名]
# 或者: from PyQt4.QtGui.QImageReader import height [as 别名]
def write(self, f): #TODO: separated image files (not in localBrowsingMode)
if len(self._list) == 0:
return
f.write(u'\n// Base64 encoded images\n')
for index, image in enumerate(self._list):
imageType = image[0]
if imageType == self.IMAGE_FILE:
image_path = image[1]
exists = os.path.exists(image_path)
if exists and os.path.isfile(image_path):
size = QImageReader(image_path).size()
args = (index, size.width(), size.height(), gdal2threejs.base64image(image_path))
else:
f.write(u"project.images[%d] = {data:null};\n" % index)
if exists:
err_msg = u"Not image file path"
else:
err_msg = u"Image file not found"
logMessage(u"{0}: {1}".format(err_msg, image_path))
continue
elif imageType == self.MAP_IMAGE:
width, height, extent, transp_background = image[1]
args = (index, width, height, self.renderedImage(width, height, extent, transp_background))
elif imageType == self.LAYER_IMAGE:
layerids, width, height, extent, transp_background = image[1]
args = (index, width, height, self.renderedImage(width, height, extent, transp_background, layerids))
else: #imageType == self.CANVAS_IMAGE:
transp_background = image[1]
size = self.context.mapSettings.outputSize()
args = (index, size.width(), size.height(), self.mapCanvasImage(transp_background))
f.write(u'project.images[%d] = {width:%d,height:%d,data:"%s"};\n' % args)