phoenix_title wx.lib.imagebrowser

This module provides the ImageDialog which allows to view and select an image.

Description

The wx.ImageDialog allows the user to view images and select one.

Usage

A simple usage would be:

import wx
import wx.lib.mixins.inspection as wit
import wx.lib.imagebrowser as ib

app = wit.InspectableApp()

with ib.ImageDialog(None) as dlg:
    if dlg.ShowModal() == wx.ID_OK:
        # show the selected file
        print("You Selected File: " + dlg.GetFile())
    else:
        print("You pressed Cancel")

app.MainLoop()

function_summary Functions Summary

ConvertBMP

Convert file

GetCheckeredBitmap

Creates a square RGB checkered bitmap using the two specified colors.

GetNamedBitmap


class_summary Classes Summary

FindFiles

ImageDialog

wx.ImageDialog derived from Dialog allows the user

ImagePanel

Panel()

ImageView

Window()


Functions



ConvertBMP(file_nm)

Convert file

Parameters:

file_nm (string) – path to file

Returns:

wx.Image or BAD_IMAGE



GetCheckeredBitmap(blocksize=8, ntiles=4, rgb0=b'xFF', rgb1=b'xCC')

Creates a square RGB checkered bitmap using the two specified colors.

The bitmap returned will have width = height = blocksize*ntiles*2

Parameters:
  • blocksize (int) – the number of pixels in each solid color square

  • ntiles1 (int) – the number of tiles along width and height. Each tile is 2x2 blocks.

  • rbg0 – the first color, as 3-character bytes object.

  • rgb1 – the second color, as 3-character bytes object. If only 1 character is provided, it is treated as a grey value.

Returns:

wx.Bitmap



GetNamedBitmap(name)