.. wxPython Phoenix documentation

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

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

.. include:: headings.inc



.. _wx.GenericStaticBitmap:

==========================================================================================================================================
|phoenix_title|  **wx.GenericStaticBitmap**
==========================================================================================================================================

A static bitmap control displays a bitmap.          

Native implementations on some platforms are only meant for display of the small icons in the dialog boxes. 

If you want to display larger images portably, you may use generic implementation GenericStaticBitmap declared in <wx/generic/statbmpg.h>. 

Notice that for the best results, the size of the control should be the same as the size of the image displayed in it, as happens by default if it's not resized explicitly. Otherwise, behaviour depends on the platform: under MSW, the bitmap is drawn centred inside the control, while elsewhere it is drawn at the origin of the control. You can use :meth:`~wx.GenericStaticBitmap.SetScaleMode`  to control how the image is scaled inside the control. 





         



.. seealso:: :ref:`wx.Bitmap`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>GenericStaticBitmap</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.StaticBitmap_inheritance.png" alt="Inheritance diagram of GenericStaticBitmap" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.StaticBitmap.html" title="wx.StaticBitmap" alt="" coords="44,315,173,344"/> <area shape="rect" id="node2" href="wx.Control.html" title="wx.Control" alt="" coords="63,237,155,267"/> <area shape="rect" id="node3" href="wx.Window.html" title="wx.Window" alt="" coords="60,160,157,189"/> <area shape="rect" id="node4" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="50,83,167,112"/> <area shape="rect" id="node5" href="wx.Object.html" title="wx.Object" alt="" coords="5,5,92,35"/> <area shape="rect" id="node6" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="117,5,223,35"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.GenericStaticBitmap.__init__`                                         Default constructor.
:meth:`~wx.GenericStaticBitmap.Create`                                           Creation function, for two-step construction.
:meth:`~wx.GenericStaticBitmap.GetBitmap`                                        Returns the bitmap currently used in the control.
:meth:`~wx.GenericStaticBitmap.GetClassDefaultAttributes`                        
:meth:`~wx.GenericStaticBitmap.GetIcon`                                          Returns the icon currently used in the control.
:meth:`~wx.GenericStaticBitmap.GetScaleMode`                                     Returns the scale mode currently used in the control.
:meth:`~wx.GenericStaticBitmap.SetBitmap`                                        Sets the bitmap label.
:meth:`~wx.GenericStaticBitmap.SetIcon`                                          Sets the label to the given icon.
:meth:`~wx.GenericStaticBitmap.SetScaleMode`                                     Sets the scale mode.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.GenericStaticBitmap.Bitmap`                                           See :meth:`~wx.GenericStaticBitmap.GetBitmap` and :meth:`~wx.GenericStaticBitmap.SetBitmap`
:attr:`~wx.GenericStaticBitmap.Icon`                                             See :meth:`~wx.GenericStaticBitmap.GetIcon` and :meth:`~wx.GenericStaticBitmap.SetIcon`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.GenericStaticBitmap(Control)

   **Possible constructors**::

       GenericStaticBitmap()
       
       GenericStaticBitmap(parent, id=ID_ANY, bitmap=NullBitmap,
                           pos=DefaultPosition, size=DefaultSize, style=0,
                           name=StaticBitmapNameStr)
       
   
   A static bitmap control displays a bitmap.



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self)`
      
      Default constructor.                   
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, parent, id=ID_ANY, bitmap=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, name=StaticBitmapNameStr)`
      
      Constructor, creating and showing a static bitmap control.                  
      
      
      
      
      :param `parent`: Parent window. Should not be ``None``.   
      :type `parent`: wx.Window
      :param `id`: Control identifier. A value of -1 denotes a default value.   
      :type `id`: wx.WindowID
      :param `bitmap`: 
      :type `bitmap`: wx.BitmapBundle
      :param `pos`: Window position.   
      :type `pos`: wx.Point
      :param `size`: Window size.   
      :type `size`: wx.Size
      :param `style`: Window style. See :ref:`wx.StaticBitmap`.   
      :type `style`: long
      :param `name`: Window name.  
      :type `name`: string
      
      
      
      
      
      
      
      
      Bitmap label.  
      
      
      
      
      
      
      
      
      
                        
      
      
      
      .. seealso:: :meth:`Create`     
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: Create(self, parent, id=ID_ANY, bitmap=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, name=StaticBitmapNameStr)

      Creation function, for two-step construction.                  

      For details see :ref:`wx.StaticBitmap`.                  


      :param `parent`: 
      :type `parent`: wx.Window
      :param `id`: 
      :type `id`: wx.WindowID
      :param `bitmap`: 
      :type `bitmap`: wx.BitmapBundle
      :param `pos`: 
      :type `pos`: wx.Point
      :param `size`: 
      :type `size`: wx.Size
      :param `style`: 
      :type `style`: long
      :param `name`: 
      :type `name`: string




      :rtype: `bool`








   .. method:: GetBitmap(self)

      Returns the bitmap currently used in the control.                  

      Notice that this method can be called even if :meth:`SetIcon`   had been used. 

                

      :rtype: :ref:`wx.Bitmap`







      .. seealso:: :meth:`SetBitmap`     








   .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)




      :param `variant`: 
      :type `variant`: wx.WindowVariant




      :rtype: :ref:`wx.VisualAttributes`








   .. method:: GetIcon(self)

      Returns the icon currently used in the control.                  

      Notice that this method can only be called if :meth:`SetIcon`   had been used: an icon can't be retrieved from the control if a bitmap had been set (using :meth:`wx.StaticBitmap.SetBitmap` ). 

                

      :rtype: :ref:`wx.Icon`







      .. seealso:: :meth:`SetIcon`     








   .. method:: GetScaleMode(self)

      Returns the scale mode currently used in the control.                  

                

      :rtype: :ref:`wx.GenericStaticBitmap.ScaleMode`







      .. versionadded:: 4.1/wxWidgets-3.1.0  
     







      .. seealso:: :meth:`SetScaleMode`   








   .. method:: SetBitmap(self, label)

      Sets the bitmap label.                  




      :param `label`: The new bitmap.  
      :type `label`: wx.BitmapBundle




                  



      .. seealso:: :meth:`GetBitmap`     








   .. method:: SetIcon(self, label)

      Sets the label to the given icon.                  




      :param `label`: The new icon.   
      :type `label`: wx.Icon




                  





   .. method:: SetScaleMode(self, scaleMode)

      Sets the scale mode.                  




      :param `scaleMode`: Controls how the bitmap is scaled inside the control.  
      :type `scaleMode`: wx.GenericStaticBitmap.ScaleMode




                  



      .. versionadded:: 4.1/wxWidgets-3.1.0  
     







      .. note:: 

         Currently only the generic implementation supports all scaling modes. You may use generic implementation GenericStaticBitmap declared in <wx/generic/statbmpg.h> in all ports.  







      .. seealso:: :meth:`GetScaleMode`   








   .. attribute:: Bitmap

      See :meth:`~wx.GenericStaticBitmap.GetBitmap` and :meth:`~wx.GenericStaticBitmap.SetBitmap`


   .. attribute:: Icon

      See :meth:`~wx.GenericStaticBitmap.GetIcon` and :meth:`~wx.GenericStaticBitmap.SetIcon`


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

   wx.GenericStaticBitmap.ScaleMode.enumeration
