VEX V5 Python API
Public Member Functions | Static Public Member Functions | List of all members
vex.Bitmap Class Reference

brief Bitmap that can be drawn using brain.Screen.drawBitmap More...

Public Member Functions

def __init__ (self, width, height, pixel_data=None)
 brief Create a bitmap from a raw pixel data param pixel_data pixels: list or tuple of color values, or a string of raw bytes returns a new Bitmap object More...
 

Static Public Member Functions

def from_png (png_data)
 Create a bitmap from PNG format data. More...
 
def from_png_file (filename)
 Create a bitmap from PNG file. More...
 

Detailed Description

brief Bitmap that can be drawn using brain.Screen.drawBitmap

Constructor & Destructor Documentation

◆ __init__()

def vex.Bitmap.__init__ (   self,
  width,
  height,
  pixel_data = None 
)

brief Create a bitmap from a raw pixel data param pixel_data pixels: list or tuple of color values, or a string of raw bytes returns a new Bitmap object

Member Function Documentation

◆ from_png()

def vex.Bitmap.from_png (   png_data)
static

Create a bitmap from PNG format data.

Parameters
png_databytes of the PNG image: bytearray, list, tuple or string of raw bytes
Returns
a new Bitmap object

◆ from_png_file()

def vex.Bitmap.from_png_file (   filename)
static

Create a bitmap from PNG file.

Parameters
filenamestring name of file on SD card, e.g. "MyImage.png"
Returns
a new Bitmap object