Beispiel #1
0
	def initBitmap(self, image_changed=0):
		#print image_changed
		#if self._threadCondition.acquire():
		sz=self.GetSize()
		sz.x=sz.x-self._border*2
		sz.y=sz.y-self._border*2-self._nameSpaceHeight
		self.impos=[self._border, self._border]
		'''if image_changed and hasattr(self, 'gifC'):
			#print 'del'
			self.gifC.Stop()
			self.gifC.Destroy()
			del self.gifC
		if self.imPath.split('.')[-1].lower() == 'gif':
			if hasattr(self, 'gifC'):
				return
			if hasattr(self, 'pic'):
				self.Refresh(0)
				del self.pic
			gif=_A.Animation(self.imPath)
			self.gifC=_A.AnimationCtrl(self, -1, gif, (self.impos[0], self.impos[1]))
			self.gifC.Play()
			#wx.Yield()
			return'''
		if hasattr(self,'image') and not image_changed:
			im = self.image.Copy()
		else:
			self.image=wx.Image(self.imPath)
			im = self.image.Copy()
		_dp.adjustImSize(im, (sz.x, sz.y))
		x,y=im.GetSize()
		self.impos[0]=_ct.Iround(abs(sz.x-x)/2)+self._border
		self.impos[1]=_ct.Iround(abs(sz.y-y)/2)+self._border

		self.pic=im.ConvertToBitmap()
		self.GetParent().GetParent().Enable(True)
		self.reInitBuffer=1
Beispiel #2
0
	def test(self, e):			#测试用
		"""global _WaitingHandler
		if _WaitingHandler:
			_WaitingHandler.Hide()
		else:
			_WaitingHandler=_ct.WaitingFrame(self.parent)"""
		#ss=self.Sizer
		#ss.Add(ImContainer(self, 'label', self.paths[0]))
		#self.Init()
		#print e.GetEventHandler()
		#print len(ss.GetChildren())
		for c in self.Sizer.GetChildren():
			si=c.GetWindow().image
			#print type(si.GetData())
			arr=_dp.cvtImObject(si)
			arr=_dp.adjustImSize(arr, (1000,650))
			cv2.imshow('test', arr)
			break