static void draw_bitmaps(GCanvas* canvas) { GBitmap tex; tex.readFromFile("spock_png"); canvas->fillRectBitmap(GRect::MakeWH(tex.width(), tex.height()), tex); canvas->fillRectBitmap(GRect::MakeLTRB(10, 140, 138, 500), tex); canvas->fillRectBitmap(GRect::MakeLTRB(140, 10, 500, 138), tex); canvas->fillRectBitmap(GRect::MakeXYWH(256, 256, 512, 512), tex); }
static void draw_spocks_zoom(GCanvas* canvas) { const int N = 300; GBitmap tex; tex.readFromFile("apps/spock.png"); for (int i = 0; i < 9; ++i) { GRect r = GRect::MakeLTRB(i * 10, i * 10, N - i * 10, N - i * 10); canvas->fillBitmapRect(tex, r); } }
static void draw_spocks_quad(GCanvas* canvas) { const int N = 300; GBitmap tex; tex.readFromFile("apps/spock.png"); for (int y = 0; y < 2; ++y) { for (int x = 0; x < 2; ++x) { canvas->fillBitmapRect(tex, GRect::MakeXYWH(x * N - N/2, y * N - N/2, N, N)); } } }
static Shape* cons_up_shape(int index) { const char* names[] = { "apps/spock.png", "expected/blend_black.png", "expected/circles_blend.png", "expected/solid_ramp.png", "expected/spocks_zoom.png", "expected/blend_white.png", "expected/circles_fat.png", "expected/spocks_quad.png", }; GBitmap bm; if (index < GARRAY_COUNT(names) && bm.readFromFile(names[index])) { return new BitmapShape(bm); } return NULL; }