예제 #1
0
파일: image.cpp 프로젝트: msarett/575
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);
}
예제 #2
0
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);
    }
}
예제 #3
0
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));
        }
    }
}
예제 #4
0
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;
}