parameters: (self, bmp, thumb, index)
docstring: Draws a visible thumbnail.
  
          :param `bmp`: the thumbnail version of the original image;
          :param `thumb`: an instance of :class:`Thumb`;
          :param `index`: the index of the thumbnail to draw.
docstring_summary: Draws a visible thumbnail.
docstring_tokens: Draws a visible thumbnail .
function: def DrawThumbnail(self, bmp, thumb, index):
          """
          Draws a visible thumbnail.
  
          :param `bmp`: the thumbnail version of the original image;
          :param `thumb`: an instance of :class:`Thumb`;
          :param `index`: the index of the thumbnail to draw.
          """
  
          dc = wx.MemoryDC()
          dc.SelectObject(bmp)
          dc.BeginDrawing()
          
          x = self._tBorder/2
          y = self._tBorder/2
  
          # background
          dc.SetPen(wx.Pen(wx.BLACK, 0, wx.TRANSPARENT))
          dc.SetBrush(wx.Brush(self.GetBackgroundColour(), wx.SOLID))
          dc.DrawRectangle(0, 0, bmp.GetWidth(), bmp.GetHeight())
          
          # image
          img = thumb.GetBitmap(self._tWidth, self._tHeight)
          ww = img.GetWidth()
          hh = img.GetHeight()
  
          if index == self.GetPointed() and self.GetHighlightPointed():
              factor = 1.5
              img = self._imageHandler.HighlightImage(img.ConvertToImage(), factor).ConvertToBitmap()
          
          imgRect = wx.Rect(x + (self._tWidth - img.GetWidth())/2,
                            y + (self._tHeight - img.GetHeight())/2,
                            img.GetWidth(), img.GetHeight())
  
          if not thumb._alpha and self._dropShadow:
              dc.Blit(imgRect.x+5, imgRect.y+5, imgRect.width, imgRect.height, self.shadow, 500-ww, 500-hh)        
          dc.DrawBitmap(img, imgRect.x, imgRect.y, True)
  
          colour = self.GetSelectionColour()
          selected = self.IsSelected(index)
   
          colour = self.GetSelectionColour()
  
          # draw caption
          sw, sh = 0, 0
          if self._showfilenames:
              textWidth = 0
              dc.SetFont(self.GetCaptionFont())
              mycaption = thumb.GetCaption(0)
              sw, sh = dc.GetTextExtent(mycaption)
  
              if sw > self._tWidth:
                  mycaption = self.CalculateBestCaption(dc, mycaption, sw, self._tWidth)
                  sw = self._tWidth
              
              textWidth = sw + 8
              tx = x + (self._tWidth - textWidth)/2
              ty = y + self._tHeight
  
              txtcolour = "#7D7D7D"
              dc.SetTextForeground(txtcolour) 
              
              tx = x + (self._tWidth - sw)/2
              if hh >= self._tHeight:
                  ty = y + self._tHeight + (self._tTextHeight - sh)/2 + 3
              else:
                  ty = y + hh + (self._tHeight-hh)/2 + (self._tTextHeight - sh)/2 + 3
  
              dc.DrawText(mycaption, tx, ty)
              
          # outline
          if self._tOutline != THUMB_OUTLINE_NONE and (self._tOutlineNotSelected or self.IsSelected(index)):
  
              dotrect = wx.Rect()
              dotrect.x = x - 2
              dotrect.y = y - 2
              dotrect.width = bmp.GetWidth() - self._tBorder + 4
              dotrect.height = bmp.GetHeight() - self._tBorder + 4
          
              dc.SetPen(wx.Pen((self.IsSelected(index) and [colour] or [wx.LIGHT_GREY])[0],
                               0, wx.SOLID))       
              dc.SetBrush(wx.Brush(wx.BLACK, wx.TRANSPARENT))
          
              if self._tOutline == THUMB_OUTLINE_FULL or self._tOutline == THUMB_OUTLINE_RECT:
  
                  imgRect.x = x
                  imgRect.y = y
                  imgRect.width = bmp.GetWidth() - self._tBorder
                  imgRect.height = bmp.GetHeight() - self._tBorder
  
                  if self._tOutline == THUMB_OUTLINE_RECT:
                      imgRect.height = self._tHeight             
  
              dc.SetBrush(wx.TRANSPARENT_BRUSH)
  
              if selected:
  
                  dc.SetPen(self.grayPen)
                  dc.DrawRoundedRectangleRect(dotrect, 2)
                  
                  dc.SetPen(wx.Pen(wx.WHITE))
                  dc.DrawRectangle(imgRect.x, imgRect.y,
                                   imgRect.width, imgRect.height)
  
                  pen = wx.Pen((selected and [colour] or [wx.LIGHT_GREY])[0], 2)
                  pen.SetJoin(wx.JOIN_MITER)
                  dc.SetPen(pen)
                  if self._tOutline == THUMB_OUTLINE_FULL:
                      dc.DrawRoundedRectangle(imgRect.x - 1, imgRect.y - 1,
                                              imgRect.width + 3, imgRect.height + 3, 2)
                  else:
                      dc.DrawRectangle(imgRect.x - 1, imgRect.y - 1,
                                       imgRect.width + 3, imgRect.height + 3)
              else:
                  dc.SetPen(wx.Pen(wx.LIGHT_GREY))
  
                  dc.DrawRectangle(imgRect.x - 1, imgRect.y - 1,
                                   imgRect.width + 2, imgRect.height + 2)
              
    
          dc.EndDrawing()
          dc.SelectObject(wx.NullBitmap)
function_tokens: def DrawThumbnail ( self , bmp , thumb , index ) : dc = wx . MemoryDC ( ) dc . SelectObject ( bmp ) dc . BeginDrawing ( ) x = self . _tBorder / 2 y = self . _tBorder / 2 # background dc . SetPen ( wx . Pen ( wx . BLACK , 0 , wx . TRANSPARENT ) ) dc . SetBrush ( wx . Brush ( self . GetBackgroundColour ( ) , wx . SOLID ) ) dc . DrawRectangle ( 0 , 0 , bmp . GetWidth ( ) , bmp . GetHeight ( ) ) # image img = thumb . GetBitmap ( self . _tWidth , self . _tHeight ) ww = img . GetWidth ( ) hh = img . GetHeight ( ) if index == self . GetPointed ( ) and self . GetHighlightPointed ( ) : factor = 1.5 img = self . _imageHandler . HighlightImage ( img . ConvertToImage ( ) , factor ) . ConvertToBitmap ( ) imgRect = wx . Rect ( x + ( self . _tWidth - img . GetWidth ( ) ) / 2 , y + ( self . _tHeight - img . GetHeight ( ) ) / 2 , img . GetWidth ( ) , img . GetHeight ( ) ) if not thumb . _alpha and self . _dropShadow : dc . Blit ( imgRect . x + 5 , imgRect . y + 5 , imgRect . width , imgRect . height , self . shadow , 500 - ww , 500 - hh ) dc . DrawBitmap ( img , imgRect . x , imgRect . y , True ) colour = self . GetSelectionColour ( ) selected = self . IsSelected ( index ) colour = self . GetSelectionColour ( ) # draw caption sw , sh = 0 , 0 if self . _showfilenames : textWidth = 0 dc . SetFont ( self . GetCaptionFont ( ) ) mycaption = thumb . GetCaption ( 0 ) sw , sh = dc . GetTextExtent ( mycaption ) if sw > self . _tWidth : mycaption = self . CalculateBestCaption ( dc , mycaption , sw , self . _tWidth ) sw = self . _tWidth textWidth = sw + 8 tx = x + ( self . _tWidth - textWidth ) / 2 ty = y + self . _tHeight txtcolour = "#7D7D7D" dc . SetTextForeground ( txtcolour ) tx = x + ( self . _tWidth - sw ) / 2 if hh >= self . _tHeight : ty = y + self . _tHeight + ( self . _tTextHeight - sh ) / 2 + 3 else : ty = y + hh + ( self . _tHeight - hh ) / 2 + ( self . _tTextHeight - sh ) / 2 + 3 dc . DrawText ( mycaption , tx , ty ) # outline if self . _tOutline != THUMB_OUTLINE_NONE and ( self . _tOutlineNotSelected or self . IsSelected ( index ) ) : dotrect = wx . Rect ( ) dotrect . x = x - 2 dotrect . y = y - 2 dotrect . width = bmp . GetWidth ( ) - self . _tBorder + 4 dotrect . height = bmp . GetHeight ( ) - self . _tBorder + 4 dc . SetPen ( wx . Pen ( ( self . IsSelected ( index ) and [ colour ] or [ wx . LIGHT_GREY ] ) [ 0 ] , 0 , wx . SOLID ) ) dc . SetBrush ( wx . Brush ( wx . BLACK , wx . TRANSPARENT ) ) if self . _tOutline == THUMB_OUTLINE_FULL or self . _tOutline == THUMB_OUTLINE_RECT : imgRect . x = x imgRect . y = y imgRect . width = bmp . GetWidth ( ) - self . _tBorder imgRect . height = bmp . GetHeight ( ) - self . _tBorder if self . _tOutline == THUMB_OUTLINE_RECT : imgRect . height = self . _tHeight dc . SetBrush ( wx . TRANSPARENT_BRUSH ) if selected : dc . SetPen ( self . grayPen ) dc . DrawRoundedRectangleRect ( dotrect , 2 ) dc . SetPen ( wx . Pen ( wx . WHITE ) ) dc . DrawRectangle ( imgRect . x , imgRect . y , imgRect . width , imgRect . height ) pen = wx . Pen ( ( selected and [ colour ] or [ wx . LIGHT_GREY ] ) [ 0 ] , 2 ) pen . SetJoin ( wx . JOIN_MITER ) dc . SetPen ( pen ) if self . _tOutline == THUMB_OUTLINE_FULL : dc . DrawRoundedRectangle ( imgRect . x - 1 , imgRect . y - 1 , imgRect . width + 3 , imgRect . height + 3 , 2 ) else : dc . DrawRectangle ( imgRect . x - 1 , imgRect . y - 1 , imgRect . width + 3 , imgRect . height + 3 ) else : dc . SetPen ( wx . Pen ( wx . LIGHT_GREY ) ) dc . DrawRectangle ( imgRect . x - 1 , imgRect . y - 1 , imgRect . width + 2 , imgRect . height + 2 ) dc . EndDrawing ( ) dc . SelectObject ( wx . NullBitmap )