type gr_bitmap =
{ bm_window : gr_window
; mutable bm_left : int
; mutable bm_top : int
; mutable bm_bitmap : image
; mutable bm_callback : gr_bitmap -> event -> bool
}
;;
the variables needed to manage an image of type gr_bitmap are:
- the attached window (bm_window),
- the lower left corner's coordinates (bm_left,bm_top),
- the image itself (bm_bitmap),
- the function called when the mouse button is pressed or released
or when a key is pressed and when the mouse pointer is on the image
(bm_callback).
The definitions linked to gr_bitmap are:
gr_icon_size : int
- defines the standard size of an icon (32 pixels).
gr_draw_bitmap : gr_bitmap -> unit
- gr_draw_bitmap Bitmap draws the image Bitmap.
gr_draw_center_bitmap : gr_bitmap -> rect -> unit
- gr_draw_center_bitmap Bitmap Rect draws the image Bitmap in the
center of the rectangle Rect.
gr_bitmap_managed : gr_bitmap -> event ->
bool;;
- its the function used by Camlwin to manage the images.