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.




Function CreatePicture(width As Integer, height As Integer) As Picture
  Return New Picture(width, height)
End Function
 
Sub FillPicture(ByRef p As Picture, FillColor As Color)
  p.Graphics.ForeColor = FillColor
  p.Graphics.FillRect(0, 0, p.Width, p.Height)
End Sub
 
Function GetPixelColor(p As Picture, x As Integer, y As Integer) As Color
  Return p.RGBSurface.Pixel(x, y)
End Function
 
Sub SetPixelColor(p As Picture, x As Integer, y As Integer, pColor As Color)
  p.RGBSurface.Pixel(x, y) = pColor
End Sub
 