Tscope5
bitmaps1.c

read a bitmap from a file, default coordinates

#include <tscope5.h>
int main()
{
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/2.0-50.0, -dh/2.0+50.0);
// flipped draw
ts5_draw_flipped_bitmap(map, 0.0, 0.0, TS5_FLIP_VERTICAL);
ts5_draw_mouse_button(dw/2.0-50.0, -dh/2.0+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/2.0-50.0, -dh/2.0+50.0);
// draw region
ts5_draw_bitmap_region(map, -100.0, -100.0, 100.0, 100.0, 0.0, 0.0);
ts5_draw_mouse_button(dw/2.0-50.0, -dh/2.0+50.0);
// draw rotated bitmap
ts5_draw_rotated_bitmap(map, -100.0, -100.0, 45.0, 0.0, 0.0);
ts5_draw_mouse_button(dw/2.0-50.0, -dh/2.0+50.0);
// draw scaled bitmap
ts5_draw_scaled_bitmap(map, dw/bw, dh/bh, 0.0, 0.0);
ts5_draw_mouse_button(dw/2.0-50.0, -dh/2.0+50.0);
return 0;
}