|Anonymous | Login | Signup for a new account||2015-07-30 00:09 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004005||OCaml||OCaml general||public||2006-04-16 16:11||2012-09-11 14:54|
|Target Version||4.00.1+dev||Fixed in Version|
|Summary||0004005: Graphics.lineto forgets drawing one pixel|
|Description||According to the lastest documentation of OCaml, Graphics.get_image's parameters must be the same as for Graphics.fill_rect. However, this code : |
let _ =
let () = Graphics.open_graph "" in
let ii = Graphics.get_image 0 0 10 10 in
let () = Graphics.fill_rect 0 0 10 10 in
let () = Graphics.draw_image ii 0 0 in
Printf.printf "%s %s\n[Enter] " Sys.os_type Sys.ocaml_version;
ignore (read_line ());
doesn't behave as expecting (i.e. drawing a rectangle with Graphics.foreground color and restoring the default screen). On OCaml Win32 3.09.0 we see at the end one line whereas there are two lines on OCaml Unix 3.09.1.
If the goal of this function is to leave the screen with one or two lines, after launching this program on Unix and Win32, we must then have the same screen at the end.
If Graphics.get_image have to cover the same space as Graphics.fill_rect, the rectangle drawn by Graphics.fill_rect on Win32 must not be translated by one pixel (see err_fill_rect.ml), and Graphics.draw_rect must also be corrected too.
For any w >= 0 and h >= 0, all the pixel have the Graphics.foreground color on Unix 3.09.1, this is not true on Win32 3.09.0 (for example, take w = 3 and h = 5).
The problem probably comes from Graphics.lineto (see err_lineto.ml for details).
The third file test.ml try to find the dimension of any rectangle, useful to determine precisely which function we may use instead of Graphics.fill_rect.
|Tags||No tags attached.|
|Attached Files||error.tar.gz [^] (1,697 bytes) 2006-04-16 16:11|
Quite frankly, the Graphics module is not intended for serious work. You can work around this problem by making your get_image and draw_image slightly larger (probably, one pixel in every direction would work).
|2006-04-16 16:11||Frederic||New Issue|
|2006-04-16 16:11||Frederic||File Added: error.tar.gz|
|2006-08-29 17:48||doligez||Status||new => acknowledged|
|2012-07-11 16:43||doligez||Target Version||=> 4.01.0+dev|
|2012-07-31 13:37||doligez||Target Version||4.01.0+dev => 4.00.1+dev|
|2012-09-11 14:54||doligez||Note Added: 0008067|
|2012-09-11 14:54||doligez||Status||acknowledged => resolved|
|2012-09-11 14:54||doligez||Resolution||open => won't fix|
|Copyright © 2000 - 2011 MantisBT Group|