Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] problem with get/draw_image
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jean-Baptiste Rouquier <jb.rouquier@w...>
Subject: [Caml-list] problem with get/draw_image
I've a problem using the Graphics library under Windows. Precisely,
get_image doesn't seem to work.
lineto and fil_rect work (I didn't take the time to test all the functions),
but I can't use the camlimages library.
Thanks for any help,

Here is a code sample :
#load "graphics.cma";;
open Graphics;;
open_graph "";;
moveto 50 10; lineto 10 50;;
 (*I get a line, perfect.*)
let img = get_image 0 0 60 60;;
draw_image img 20 20;;
 (*the line is cut because of the clipped image, but no other line appear.*)

camlimages is able to clip images onto the graphics window, so make_image
and draw_image seem to work (I've also tested them). But when trying to
capture the graphics windows via Graphics.get_image and dump_image, I get
either a black image or a white one (perhaps depending on the size (!)).

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: