Created
October 2, 2019 19:57
-
-
Save stoffera/622a931cdf7ab11b0355e0ff4a2917b3 to your computer and use it in GitHub Desktop.
Display BMP on OpenMono
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "app_controller.h" | |
AppController::AppController() : | |
fs("sd"), | |
img("/sd/mono/mockups/ToDo.bmp"), | |
bmpView(&img) | |
{ | |
} | |
void AppController::monoWakeFromReset() | |
{ | |
bmpView.show(); | |
} | |
void AppController::monoWillGotoSleep() | |
{ | |
} | |
void AppController::monoWakeFromSleep() | |
{ | |
// this will not work - since FS has lost its state | |
bmpView.scheduleRepaint(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef app_controller_h | |
#define app_controller_h | |
#include <mono.h> | |
// import the SD card and FS definitions | |
#include <io/file_system.h> | |
#include <stdio.h> | |
class AppController : public mono::IApplication { | |
mono::io::FileSystem fs; // create an instance of the FS I/O | |
mono::media::BMPImage img; // create a bmp image representation | |
mono::ui::ImageView bmpView; // create a UI view to display the image | |
public: | |
AppController(); | |
void monoWakeFromReset(); | |
void monoWillGotoSleep(); | |
void monoWakeFromSleep(); | |
}; | |
#endif /* app_controller_h */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment