Show a basic storage type to handle a simple RGB raster graphics image,
and some primitive associated functions.

If possible provide a function to allocate an uninitialised image,
given its width and height, and provide 3 additional functions:

   one to fill an image with a plain RGB color,
   one to set a given pixel with a color,
   one to get the color of a pixel.


(If there are specificities about the storage or the allocation, explain those.)

These functions are used as a base for the articles in the category raster graphics operations, 
and a basic output function to check the results
is available in the article write ppm file.




Screenres 320, 240, 8
Dim Shared As Integer w, h
Screeninfo w, h
Const As Ubyte cyan    = 3
Const As Ubyte red     = 4
 
Sub rellenar(c As Integer)
    Line (0,0) - (w/3, h/3), red, BF
End Sub
 
Sub establecePixel(x As Integer, y As Integer, c As Integer)
    Pset (x,y), cyan
End Sub
 
rellenar(12)
establecePixel(10,10, cyan)
Locate 12
Print "pixel 10,10 es " & Point(10,10)
Print "pixel 20,20 es " & Point(20,10)
 
Bsave "FreeBASIC_bitmap.bmp", 0
Sleep