File: wx.lib.imagebrowser.txt

package info (click to toggle)
wxpython4.0 4.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 211,112 kB
  • sloc: cpp: 888,355; python: 223,130; makefile: 52,087; ansic: 45,780; sh: 3,012; xml: 1,534; perl: 264
file content (125 lines) | stat: -rw-r--r-- 3,883 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. module:: wx.lib.imagebrowser

.. currentmodule:: wx.lib.imagebrowser

.. highlight:: python



.. _wx.lib.imagebrowser:

==========================================================================================================================================
|phoenix_title|  **wx.lib.imagebrowser**
==========================================================================================================================================

This module provides the :class:`~lib.imagebrowser.ImageDialog` which allows to view and select
an image.


Description
===========

The :class:`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
====================================

================================================================================ ================================================================================
:func:`~wx.lib.imagebrowser.ConvertBMP`                                          Convert file
:func:`~wx.lib.imagebrowser.GetCheckeredBitmap`                                  Creates a square RGB checkered bitmap using the two specified colors.
:func:`~wx.lib.imagebrowser.GetNamedBitmap`                                      
================================================================================ ================================================================================


|


|class_summary| Classes Summary
===============================

================================================================================ ================================================================================
:ref:`~wx.lib.imagebrowser.FindFiles`                                            
:ref:`~wx.lib.imagebrowser.ImageDialog`                                          :class:`wx.ImageDialog` derived from :class:`Dialog` allows the user
:ref:`~wx.lib.imagebrowser.ImagePanel`                                           
:ref:`~wx.lib.imagebrowser.ImageView`                                            
================================================================================ ================================================================================


|


.. toctree::
   :maxdepth: 1
   :hidden:

   wx.lib.imagebrowser.FindFiles
   wx.lib.imagebrowser.ImageDialog
   wx.lib.imagebrowser.ImagePanel
   wx.lib.imagebrowser.ImageView





Functions
------------

.. function:: ConvertBMP(file_nm)

   Convert file
   
   :param string `file_nm`: path to file
   
   :return: :class:`wx.Image` or BAD_IMAGE


.. function:: 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
   
   :param int `blocksize`:  the number of pixels in each solid color square
   :param int `ntiles1`:  the number of tiles along width and height.  Each
       tile is 2x2 blocks.
   :param `rbg0`: the first color, as 3-character bytes object.
   :param `rgb1`: the second color, as 3-character bytes object. If only 1
       character is provided, it is treated as a grey value.
   
   :return: :class:`wx.Bitmap`


.. function:: GetNamedBitmap(name)