[GRASS5] D_color
Glynn Clements
glynn at gclements.plus.com
Tue May 17 12:00:17 EDT 2005
Jachym Cepicky wrote:
> How to draw text to GRASS monitor?
>
> I try this with
>
> R_color(black);
> R_set_window(t, b, l, r) ;
> D_get_screen_window(&t, &b, &l, &r) ;
>
> R_text_size(txsiz, txsiz);
> R_move_abs(x0,y0);
> strcpy(buff, "hallo world\n");
> R_text(buff);
>
> D_add_to_list(G_recreate_command());
>
> but nothing is showen :-(
It's hard to say what's wrong without seeing the rest of the program.
However, the following simple test program works.
#include <stdio.h>
#include <stdlib.h>
#include <gis.h>
#include <raster.h>
#include <colors.h>
int main(int argc, char **argv)
{
struct GModule *module;
G_gisinit(argv[0]);
module = G_define_module();
module->description = "Draws text";
if (argc > 1 && G_parser(argc, argv))
exit(1);
if (R_open_driver() != 0)
G_fatal_error ("No graphics device selected");
R_standard_color(BLACK);
R_text_size(12, 12);
R_move_abs(20, 20);
R_text("hello, world");
R_close_driver();
return 0;
}
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list