Tscope5
bitmaps3.c

read a bitmap from a file, display coordinate system

#include <tscope5.h>
int main()
{
ts5_set_coordinate_system(TS5_DISPLAY_COORDINATES);
double dw, dh;
ts5_get_display_size(1, &dw, &dh);
TS5_BITMAP *map = ts5_read_bitmap("boe.jpg");
double bw, bh;
ts5_get_bitmap_size(map, &bw, &bh);
// regular draw
ts5_draw_bitmap(map, 0.0, 0.0);
ts5_draw_mouse_button(dw-50.0, dh-50.0);
// flipped draw
ts5_draw_flipped_bitmap(map, 0.0, 0.0, TS5_FLIP_VERTICAL);
ts5_draw_mouse_button(dw-50.0, dh-50.0);
// tinted draw
TS5_COLOR tint = ts5_make_named_color("lawngreen", 1.0);
ts5_draw_tinted_bitmap(map, tint, 0.0, 0.0);
ts5_draw_mouse_button(dw-50.0, dh-50.0);
// draw region
ts5_draw_bitmap_region(map, 0.0, 0.0, 200.0, 200.0, 0.0, 0.0);
ts5_draw_mouse_button(dw-50.0, dh-50.0);
// draw rotated bitmap
ts5_draw_rotated_bitmap(map, 0.0, 0.0, 45.0, 0.0, 0.0);
ts5_draw_mouse_button(dw-50.0, dh-50.0);
// draw scaled bitmap
ts5_draw_scaled_bitmap(map, dw/bw, dh/bh, 0.0, 0.0);
ts5_draw_mouse_button(dw-50.0, dh-50.0);
return 0;
}