Tscope5
bitmaps02.c
////////////////////////////////////////////////////////////////////////////////
//
// __ ______
// / /_______________ ____ ___ / ____/
// / __/ ___/ ___/ __ \/ __ \/ _ \ /___ )
// / /_(__ ) /__/ /_/ / /_/ / __/ ____/ /
// \__/____/\___/\____/ .___/\___/ /_____/
// /_/
//
// bitmaps02.c
// - Illustration of the bitmap drawing functions.
// - Relative coordinate scale.
////////////////////////////////////////////////////////////////////////////////
#include <tscope5.h>
int main()
{
// open a display and set graphics parameters
double dw, dh;
ts5_get_display_size(1, &dw, &dh);
ts5_set_coordinate_scale(TS5_RELATIVE_COORDINATES);
// read the bitmap
double bw, bh;
TS5_BITMAP *map = ts5_read_bitmap("boe.jpg");
ts5_get_bitmap_size(map, &bw, &bh);
// regular draw
ts5_draw_bitmap(map, 0.0, 0.0);
// flipped draw
ts5_draw_flipped_bitmap(map, 0.0, 0.0, TS5_FLIP_VERTICAL);
// tinted draw
TS5_COLOR tint = ts5_make_named_color("lawngreen", 1.0);
ts5_draw_tinted_bitmap(map, tint, 0.0, 0.0);
// draw region
ts5_draw_bitmap_region(map, -0.5, -0.5, 0.5, 0.5, 0.0, 0.0);
// draw rotated bitmap
ts5_draw_rotated_bitmap(map, -0.5, -0.5, 45.0, 0.0, 0.0);
// draw scaled bitmap
ts5_draw_scaled_bitmap(map, 2.0, 2.0, 0.0, 0.0);
// free the bitmap
return 0;
}