Hi all, I want to create a bitmap graphics (black on white) completely under algorithmic control, without any user interaction and without any visible graphics window on the screen. At the end the result should be a bmp file.
Given the manual example below (already modified), I experimententally started with i=CREATE_GRAPHICS_REGION@( hnd1,400,300 ) and finished with i= EXPORT_IMAGE@( 'filename.bmp' ) .
The result is a bit unstable (sometomes just black background, sometimes the ellipse is black), because I do not know how %gr and CREATE do interact. Without any %gr, the result is a black rectangle.
Question 1: who has a receipe for my task? Question 2: what means 'L' in 300L in the %gr parameters?
My junky test program:
! test to draw with %gr
program drawtests
INCLUDE <windows.ins>
INTEGER ctrl,hnd1
DATA hnd1/1/
! ----Graphics handles are input values to %gr ---
!
CALL SYSTEM ('del filename.bmp')
i=CREATE_GRAPHICS_REGION@( hnd1,400,300 ) ! silent mode?
CALL set_rgb_colours_default@(1)
CALL SET_CONTROL_BACK_COLOUR@(hnd1,RGB@(255,255,255))
! without the next two lines the result is a black rectangle i=winio@('%`gr[white,rgb_colours]&',400L,300L,hnd1) i=winio@('%ww%lw',ctrl)
i=select_graphics_object@(hnd1)
CALL SET_LINE_WIDTH@( 5 )
CALL draw_line_between@(100,100,300,200,RGB@(0,0,255))
CALL draw_filled_ellipse@(200,150,75,50,RGB@(255,0,0))
i= EXPORT_IMAGE@( 'filename.bmp' )
end