Tscope5
graphics3.c

display size and position, display coordinate system

#include <tscope5.h>
int main()
{
ts5_set_coordinate_system(TS5_DISPLAY_COORDINATES);
double mw, mh;
ts5_set_display_position(100.0, 100.0);
ts5_set_display_size(mw/2.0, mh/2.0);
double dw, dh;
ts5_get_display_size(1, &dw, &dh);
double dx, dy;
TS5_BITMAP *map = ts5_alloc_bitmap(dw/2.0, dh/2.0);
double bw, bh;
ts5_get_bitmap_size(map, &bw, &bh);
ts5_draw_bitmap(map, dw/4.0, dh/4.0);
ts5_printf(dw/2.0, dh/2.0 - 20.0, "display adapter size: %.0f x %.0f", mw, mh);
ts5_printf(dw/2.0, dh/2.0, "display size: %5.2f x %5.2f", dw, dh);
ts5_printf(dw/2.0, dh/2.0 + 20.0, "display position: %5.2f x %5.2f", dx, dy);
ts5_printf(dw/2.0, dh/2.0 + 40.0, "bitmap size: %5.2f x %5.2f", bw, bh);
ts5_draw_mouse_button(dw-50.0, dh-50.0);
return 0;
}