FEHImage

back to FEHImages

Note: This class is only available for use on the Proteus Simulator

Description

Library: FEHImages.h

This class can be used to draw .png images to the Proteus Simulator screen.
Images will retain any transparency present in the .png file, and oversized images will not be rescaled but rather clipped to fit on the screen when .Draw() is called.

After opening an image with the .Open() method (or by specifying a filename in the constructor) calling the .Draw() method will place the image on the screen.

It is recommended to use multiple FEHImage objects/variables to deal with multiple pictures, rather than sequentially opening and drawing them from a single object.

Member Functions

void Open(const char *filename);
void Draw(int x, int y);

Declaration

FEHImage <variable/object name>;
// Optionally open file in constructor
FEHImage <variable name>(const char *filename);

Parameters

None.

Example

#include <FEHImages.h>

int main(void)
{
    // Declares an image for a unicorn
    FEHImage unicorn;
    // Open the image
    unicorn.Open("UnicornFEH.png");
    // Draw a unicorn in the top left corner
    unicorn.Draw(0, 0);


    // The following code is functionally identical: 
    FEHImage unicorn1("UnicornFEH.png");
    unicorn1.Draw(0, 0);

    while(1) 
        LCD.Update(); //Never quit 
    return 0;
}