當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.IMAGE_QUALITY_HIGH屬性代碼示例

本文整理匯總了Python中wx.IMAGE_QUALITY_HIGH屬性的典型用法代碼示例。如果您正苦於以下問題:Python wx.IMAGE_QUALITY_HIGH屬性的具體用法?Python wx.IMAGE_QUALITY_HIGH怎麽用?Python wx.IMAGE_QUALITY_HIGH使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在wx的用法示例。


在下文中一共展示了wx.IMAGE_QUALITY_HIGH屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: launchFileDialog

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import IMAGE_QUALITY_HIGH [as 別名]
def launchFileDialog(self, evt):
        # defining wildcard for suppported picture formats
        wildcard = "JPEG (*.jpg)|*.jpg|" \
                   "PNG (*.png)|*.png|" \
                   "GIF (*.gif)|*.gif"
        # defining the dialog object
        dialog = wx.FileDialog(self, message="Select Picture", defaultDir=os.getcwd(), defaultFile="",
                               wildcard=wildcard,
                               style=wx.FD_OPEN | wx.FD_MULTIPLE | wx.FD_CHANGE_DIR | wx.FD_FILE_MUST_EXIST | wx.FD_PREVIEW)
        # Function to retrieve file dialog response and return the full path of the first image (it is a multi-file selection dialog)
        if dialog.ShowModal() == wx.ID_OK:
            self.magic_collection[1].SetValue(
                "You have selected a Picture. It will now be processed!, Please wait! \nLoading.....")
            paths = dialog.GetPaths()

            # This adds the selected picture to the Right region. Right region object is retrieved from UI object array
            modification_bitmap1 = wx.Bitmap(paths[0])
            modification_image1 = modification_bitmap1.ConvertToImage()
            modification_image1 = modification_image1.Scale(650, 490, wx.IMAGE_QUALITY_HIGH)
            modification_bitmap2 = modification_image1.ConvertToBitmap()
            report_bitmap = wx.StaticBitmap(self.magic_collection[0], -1, modification_bitmap2, (0, 20))

            self.processPicture(paths[0],
                                "PROGRAM_INSTALL_FULLPATH\\resnet50_weights_tf_dim_ordering_tf_kernels.h5",
                                "PROGRAM_INSTALL_FULLPATH\\imagenet_class_index.json") 
開發者ID:OlafenwaMoses,項目名稱:Model-Playgrounds,代碼行數:27,代碼來源:MainUI.py

示例2: launchFileDialog

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import IMAGE_QUALITY_HIGH [as 別名]
def launchFileDialog(self, evt):
        # defining wildcard for suppported picture formats
        wildcard = "JPEG (*.jpg)|*.jpg|" \
                   "PNG (*.png)|*.png|" \
                   "GIF (*.gif)|*.gif"
        # defining the dialog object
        dialog = wx.FileDialog(self, message="Select Picture", defaultDir=os.getcwd(), defaultFile="",
                               wildcard=wildcard,
                               style=wx.FD_OPEN | wx.FD_MULTIPLE | wx.FD_CHANGE_DIR | wx.FD_FILE_MUST_EXIST | wx.FD_PREVIEW)
        # Function to retrieve file dialog response and return the full path of the first image (it is a multi-file selection dialog)
        if dialog.ShowModal() == wx.ID_OK:
            self.magic_collection[1].SetValue(
                "You have selected a Picture. It will now be processed!, Please wait! \nLoading.....")
            paths = dialog.GetPaths()

            # This adds the selected picture to the Right region. Right region object is retrieved from UI object array
            modification_bitmap1 = wx.Bitmap(paths[0])
            modification_image1 = modification_bitmap1.ConvertToImage()
            modification_image1 = modification_image1.Scale(650, 490, wx.IMAGE_QUALITY_HIGH)
            modification_bitmap2 = modification_image1.ConvertToBitmap()
            report_bitmap = wx.StaticBitmap(self.magic_collection[0], -1, modification_bitmap2, (0, 20))

            self.processPicture(paths[0],
                                "PROGRAM_INSTALL_FULLPATH\\squeezenet_weights_tf_dim_ordering_tf_kernels.h5",
                                "PROGRAM_INSTALL_FULLPATH\\imagenet_class_index.json") 
開發者ID:OlafenwaMoses,項目名稱:Model-Playgrounds,代碼行數:27,代碼來源:MainUI.py

示例3: launchFileDialog

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import IMAGE_QUALITY_HIGH [as 別名]
def launchFileDialog(self, evt):
        # defining wildcard for suppported picture formats
        wildcard = "JPEG (*.jpg)|*.jpg|" \
                   "PNG (*.png)|*.png|" \
                   "GIF (*.gif)|*.gif"
        # defining the dialog object
        dialog = wx.FileDialog(self, message="Select Picture", defaultDir=os.getcwd(), defaultFile="",
                               wildcard=wildcard,
                               style=wx.FD_OPEN | wx.FD_MULTIPLE | wx.FD_CHANGE_DIR | wx.FD_FILE_MUST_EXIST | wx.FD_PREVIEW)
        # Function to retrieve file dialog response and return the full path of the first image (it is a multi-file selection dialog)
        if dialog.ShowModal() == wx.ID_OK:
            self.magic_collection[1].SetValue(
                "You have selected a Picture. It will now be processed!, Please wait! \nLoading.....")
            paths = dialog.GetPaths()

            # This adds the selected picture to the Right region. Right region object is retrieved from UI object array
            modification_bitmap1 = wx.Bitmap(paths[0])
            modification_image1 = modification_bitmap1.ConvertToImage()
            modification_image1 = modification_image1.Scale(650, 490, wx.IMAGE_QUALITY_HIGH)
            modification_bitmap2 = modification_image1.ConvertToBitmap()
            report_bitmap = wx.StaticBitmap(self.magic_collection[0], -1, modification_bitmap2, (0, 20))

            self.processPicture(paths[0],
                                "PROGRAM_INSTALL_FULLPATH\\DenseNet-BC-121-32.h5",
                                "PROGRAM_INSTALL_FULLPATH\\imagenet_class_index.json") 
開發者ID:OlafenwaMoses,項目名稱:Model-Playgrounds,代碼行數:27,代碼來源:MainUI.py

示例4: launchFileDialog

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import IMAGE_QUALITY_HIGH [as 別名]
def launchFileDialog(self, evt):
        # defining wildcard for suppported picture formats
        wildcard = "JPEG (*.jpg)|*.jpg|" \
                   "PNG (*.png)|*.png|" \
                   "GIF (*.gif)|*.gif"
        # defining the dialog object
        dialog = wx.FileDialog(self, message="Select Picture", defaultDir=os.getcwd(), defaultFile="",
                               wildcard=wildcard,
                               style=wx.FD_OPEN | wx.FD_MULTIPLE | wx.FD_CHANGE_DIR | wx.FD_FILE_MUST_EXIST | wx.FD_PREVIEW)
        # Function to retrieve file dialog response and return the full path of the first image (it is a multi-file selection dialog)
        if dialog.ShowModal() == wx.ID_OK:
            self.magic_collection[1].SetValue(
                "You have selected a Picture. It will now be processed!, Please wait! \nLoading.....")
            paths = dialog.GetPaths()

            # This adds the selected picture to the Right region. Right region object is retrieved from UI object array
            modification_bitmap1 = wx.Bitmap(paths[0])
            modification_image1 = modification_bitmap1.ConvertToImage()
            modification_image1 = modification_image1.Scale(650, 490, wx.IMAGE_QUALITY_HIGH)
            modification_bitmap2 = modification_image1.ConvertToBitmap()
            report_bitmap = wx.StaticBitmap(self.magic_collection[0], -1, modification_bitmap2, (0, 20))

            self.processPicture(paths[0],
                                "PROGRAM_INSTALL_FULLPATH\\inception_v3_weights_tf_dim_ordering_tf_kernels.h5",
                                "PROGRAM_INSTALL_FULLPATH\\imagenet_class_index.json") 
開發者ID:OlafenwaMoses,項目名稱:Model-Playgrounds,代碼行數:27,代碼來源:MainUI.py

示例5: load_bitmap

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import IMAGE_QUALITY_HIGH [as 別名]
def load_bitmap(resource, size=None):
    bitmap = wx.Bitmap(get_resource(resource), wx.BITMAP_TYPE_PNG)
    if size is not None:
        image = wx.ImageFromBitmap(bitmap)
        image.Rescale(size.GetWidth(), size.GetHeight(),
                      wx.IMAGE_QUALITY_HIGH)
        bitmap = image.ConvertToBitmap()

    return bitmap 
開發者ID:EarToEarOak,項目名稱:RF-Monitor,代碼行數:11,代碼來源:utils_ui.py

示例6: resize_bitmap

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import IMAGE_QUALITY_HIGH [as 別名]
def resize_bitmap(parent, _bitmap, target_height):
  '''
  Resizes a bitmap to a height of 89 pixels (the
  size of the top panel), while keeping aspect ratio
  in tact
  '''
  image = wx.ImageFromBitmap(_bitmap)
  _width, _height = image.GetSize()
  if _height < target_height:
    return wx.StaticBitmap(parent, -1, wx.BitmapFromImage(image))
  ratio = float(_width) / _height
  image = image.Scale(target_height * ratio, target_height, wx.IMAGE_QUALITY_HIGH)
  return wx.StaticBitmap(parent, -1, wx.BitmapFromImage(image)) 
開發者ID:ME-ICA,項目名稱:me-ica,代碼行數:15,代碼來源:imageutil.py

示例7: GetSkinnedBitmap

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import IMAGE_QUALITY_HIGH [as 別名]
def GetSkinnedBitmap(
            textLines,
            textWidths,
            textHeights,
            textWidth,
            textHeight,
            memoryDC,
            textColour,
            skinName
    ):
        image = wx.Image(join(SKIN_DIR, skinName + ".png"))
        option = eg.Bunch()

        def Setup(minWidth, minHeight, xMargin, yMargin,
                  transparentColour=None):
            width = textWidth + 2 * xMargin
            if width < minWidth:
                width = minWidth
            height = textHeight + 2 * yMargin
            if height < minHeight:
                height = minHeight
            option.xMargin = xMargin
            option.yMargin = yMargin
            option.transparentColour = transparentColour
            bitmap = wx.EmptyBitmap(width, height)
            option.bitmap = bitmap
            memoryDC.SelectObject(bitmap)
            return width, height

        def Copy(x, y, width, height, toX, toY):
            bmp = wx.BitmapFromImage(image.GetSubImage((x, y, width, height)))
            memoryDC.DrawBitmap(bmp, toX, toY)

        def Scale(x, y, width, height, toX, toY, toWidth, toHeight):
            subImage = image.GetSubImage((x, y, width, height))
            subImage.Rescale(toWidth, toHeight, wx.IMAGE_QUALITY_HIGH)
            bmp = wx.BitmapFromImage(subImage)
            memoryDC.DrawBitmap(bmp, toX, toY)

        scriptGlobals = dict(Setup=Setup, Copy=Copy, Scale=Scale)
        eg.ExecFile(join(SKIN_DIR, skinName + ".py"), scriptGlobals)

        bitmap = option.bitmap
        memoryDC.SelectObject(wx.NullBitmap)
        bitmap.SetMask(wx.Mask(bitmap, option.transparentColour))
        memoryDC.SelectObject(bitmap)
        memoryDC.SetTextForeground(textColour)
        memoryDC.SetTextBackground(textColour)
        DrawTextLines(
            memoryDC, textLines, textHeights, option.xMargin, option.yMargin
        )
        memoryDC.SelectObject(wx.NullBitmap)
        return bitmap 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:55,代碼來源:ShowOSD.py


注:本文中的wx.IMAGE_QUALITY_HIGH屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。