当前位置: 首页>>代码示例>>Python>>正文


Python Tc2Config.readWriteImageFormats方法代码示例

本文整理汇总了Python中Tc2Config.readWriteImageFormats方法的典型用法代码示例。如果您正苦于以下问题:Python Tc2Config.readWriteImageFormats方法的具体用法?Python Tc2Config.readWriteImageFormats怎么用?Python Tc2Config.readWriteImageFormats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tc2Config的用法示例。


在下文中一共展示了Tc2Config.readWriteImageFormats方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: onButtonSaveImageClicked

# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import readWriteImageFormats [as 别名]
	def onButtonSaveImageClicked(self):
		imageFormats = imageFormats = Tc2Config.readWriteImageFormats()
		fileName = Tc2Config.dlgOpenSaveFile(
				parent=self,
				openFile=False,
				title='Save Screenshot..',
				fileFilters=('Images (%s)' % ' '.join(['*.%s' % i for i in imageFormats]), 'All Files (*)'),
				defaultSuffix='png',
				settingsKey=self.SettingsKeyDialogSaveImageState,
				)
		if fileName is None:
			return
		fileInfo = QtCore.QFileInfo(fileName)
		format = fileInfo.suffix().toLower()
		if not self.labelPixmap.pixmap().save(fileName, format):
			Tc2Config.msgWarning(self, 'Could Not Save Image')
开发者ID:minafaw,项目名称:tablecrab,代码行数:18,代码来源:Tc2DialogException.py

示例2: onButtonBackgroundImageClicked

# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import readWriteImageFormats [as 别名]
	def onButtonBackgroundImageClicked(self):
		imageFormats = Tc2Config.readWriteImageFormats()
		fileName = Tc2Config.dlgOpenSaveFile(
				parent=self,
				openFile=True,
				title='Open Background Image..',
				fileFilters=('Images (%s)' % ' '.join(['*.%s' % i for i in imageFormats]), 'All Files (*)'),
				settingsKey=self.SettingsKeyDialogOpenImageState,
				)
		if fileName is None:
			return
		imageName, pixmap = self.imageFromFileName(fileName)
		if imageName is None:
			Tc2Config.msgWarning(self, 'Could not open background image')
			return
		self.setBackgroundImage(imageName, pixmap)
开发者ID:Kostafun,项目名称:tablecrab,代码行数:18,代码来源:Tc2GuiSettingsCardProtector.py

示例3: onActionOpenImageTriggered

# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import readWriteImageFormats [as 别名]
	def onActionOpenImageTriggered(self):
		imageFormats = Tc2Config.readWriteImageFormats()
		fileName = Tc2Config.dlgOpenSaveFile(
				parent=self,
				openFile=True,
				title='Open Image..',
				fileFilters=('Images (%s)' % ' '.join(['*.%s' % i for i in imageFormats]), 'All Files (*)'),
				settingsKey=self.SettingsKeyDialogImageOpenState,
				)
		if fileName is None:
			return
		pixmap = QtGui.QPixmap()
		if not pixmap.load(fileName):
			Tc2Config.msgWarning(self, 'Could not open image')
			return
		fileInfo = QtCore.QFileInfo(fileName)
		screenshotName = fileInfo.baseName()
		self.setPixmap(pixmap=pixmap)
开发者ID:Kostafun,项目名称:tablecrab,代码行数:20,代码来源:Tc2DialogOcrEditor.py

示例4: onActionSaveImageTriggered

# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import readWriteImageFormats [as 别名]
	def onActionSaveImageTriggered(self):
		if self.labelInputImage.pixmap() is None:
			self.actionSaveImage.setEnabled(False)
			return
		imageFormats = imageFormats = Tc2Config.readWriteImageFormats()
		fileName = Tc2Config.dlgOpenSaveFile(
				parent=self,
				openFile=False,
				title='Save Image..',
				fileFilters=('Images (%s)' % ' '.join(['*.%s' % i for i in imageFormats]), 'All Files (*)'),
				defaultSuffix='png',
				settingsKey=self.SettingsKeyDialogImageSaveState,
				)
		if fileName is None:
			return
		fileInfo = QtCore.QFileInfo(fileName)
		format = fileInfo.suffix().toLower()
		if not self.labelInputImage.pixmap().save(fileName, format):
			Tc2Config.msgWarning(self, 'Could Not Save Image')
开发者ID:Kostafun,项目名称:tablecrab,代码行数:21,代码来源:Tc2DialogOcrEditor.py


注:本文中的Tc2Config.readWriteImageFormats方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。