.. wxPython Phoenix documentation

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

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

.. include:: headings.inc

.. currentmodule:: wx.lib.ogl.bmpshape

.. highlight:: python



.. _wx.lib.ogl.bmpshape.BitmapShape:

==========================================================================================================================================
|phoenix_title|  **wx.lib.ogl.bmpshape.BitmapShape**
==========================================================================================================================================

The :class:`wx.BitmapShape` class draws a bitmap (non-resizable).



|

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

.. raw:: html

   <div class="collabsible-wrapper">
      <input id="collapsible-inheritance" class="collapsible-checkbox" type="checkbox">
      <label for="collapsible-inheritance" tabindex="0" title="Show inheritance diagram" class="collapsible-label">Inheritance diagram for class <strong>BitmapShape</strong>:</label>
      <div class="collapsible-content">
         <p class="graphviz">
            <center><img src="_static/images/inheritance/wx.lib.ogl.bmpshape.BitmapShape_inheritance.svg" alt="Inheritance diagram of BitmapShape" usemap="#dummy" class="inheritance invert-in-dark-mode"/></center>
            <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.ogl.bmpshape.BitmapShape.html" title="The wx.BitmapShape class draws a bitmap (non-resizable)." alt="" coords="5,236,281,265"/> <area shape="rect" id="node2" href="wx.lib.ogl.basic.RectangleShape.html" title="The wx.RectangleShape class has rounded or square corners." alt="" coords="12,159,274,188"/> <area shape="rect" id="node3" href="wx.lib.ogl.basic.Shape.html" title="The Shape is the base class for OGL shapes." alt="" coords="49,82,238,111"/> <area shape="rect" id="node4" href="wx.lib.ogl.basic.ShapeEvtHandler.html" title="The ShapeEvtHandler class." alt="" coords="9,5,278,34"/> </map> 
         </p>
      </div>
   </div>
   <script type="text/javascript" src="_static/inheritancetoggle.js"></script>



|


|super_classes| Known Superclasses
==================================

:class:`wx.lib.ogl.basic.RectangleShape`

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.ogl.bmpshape.BitmapShape.__init__`                                Default class constructor.
:meth:`~wx.lib.ogl.bmpshape.BitmapShape.GetBitmap`                               Get the associated bitmap.
:meth:`~wx.lib.ogl.bmpshape.BitmapShape.GetFilename`                             Return the bitmap filename.
:meth:`~wx.lib.ogl.bmpshape.BitmapShape.OnDraw`                                  The draw handler.
:meth:`~wx.lib.ogl.bmpshape.BitmapShape.SetBitmap`                               Set the associated bitmap.
:meth:`~wx.lib.ogl.bmpshape.BitmapShape.SetFilename`                             Set the bitmap filename.
:meth:`~wx.lib.ogl.bmpshape.BitmapShape.SetSize`                                 Set the size.
================================================================================ ================================================================================


|


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


.. class:: BitmapShape(RectangleShape)

   The :class:`wx.BitmapShape` class draws a bitmap (non-resizable).

   .. method:: __init__(self)

      Default class constructor.


   .. method:: GetBitmap(self)

      Get the associated bitmap.


   .. method:: GetFilename(self)

      Return the bitmap filename.


   .. method:: OnDraw(self, dc)

      The draw handler.


   .. method:: SetBitmap(self, bitmap)

      Set the associated bitmap.
      
      :param `bitmap`: a :class:`wx.Bitmap` instance
      
      .. note:: You can delete the bitmap from the calling application, since
       reference counting will take care of holding on to the internal bitmap
       data.


   .. method:: SetFilename(self, f)

      Set the bitmap filename.
      
      :param str `f`: the bitmap file name


   .. method:: SetSize(self, w, h, recursive = True)

      Set the size.
      
      :param `w`: the width
      :param `h`: the height
      :param `recursive`: not used


