This is a basic example how to draw a bitmap on Pokitto screen

Dependencies:   PokittoLib

/media/uploads/Pokitto/img_20180101_122531.jpg

Pokitto drawBitmap basic example

The bitmap was created with Photoshop (but you can use any similar drawing program) and converted to a .h resource file using Filippos img2pok tool, available here: https://github.com/Effer/img2pok

To try it out yourself

Just press the "Import into compiler" button on top right of this page!

bitmap.cpp

Committer:
Pokitto
Date:
2018-05-02
Revision:
3:401b951fdcdc
Parent:
2:5ef3dd229260

File content as of revision 3:401b951fdcdc:

/* Pokitto drawBitmap example - draws a Pokitto icon by @trelemar */

#include "Pokitto.h" // include Pokitto library
#include "pokitto_icon.h" // include the Pokitto icon graphics file

Pokitto::Core mygame; //create Pokitto application instance

int main () {
    mygame.begin(); // start the application
    mygame.display.load565Palette(pokitto_icon_pal); //load the palette for the image
    mygame.display.bgcolor=0;
    /* the "while" loop runs as long as the program is running */
    while (mygame.isRunning()) {
        /* mygame.update() is processed whenever it is time to update the screen */
        if (mygame.update()) {
            mygame.display.drawBitmap(0,0,pokitto_icon); // draw the pokitto_icon graphic
            }
        }

    return 0; // this is "good programming manners". Program informs it ended without errors
}