Task

Create a window and draw a pixel in it, subject to the following:

  the window is 320 x 240
  the color of the pixel must be red (255,0,0)
  the position of the pixel is x = 100, y = 100
 
 
 
Module CheckIt {
      Module PlotPixel (a as single, b as single) {
            Move a*TwipsX, b*TwipsX
            Draw TwipsX, TwipsY
      }
      Cls 5,0  \\ clear console with Magenta (5) and set split  screen from 0 (no split screen)
      Pen #55FF77 {
            PlotPixel 1000, 200
      }
      Wait 1000
      Title "", 1
      Declare DrawPixelForm Form
      With DrawPixelForm, "Title", "Draw a Pixel at 100,100"
      Layer DrawPixelForm {
            \\ 12 for 12pt fonts
            \\ use ; to center window
            Window 12, 320*twipsx, 240*twipsy;
            Cls #333333
            Pen Color(255,0,0) {
                  PlotPixel 100, 100
            }
      }
      \\ code to show/hide console clicking form
      \\ console shown behind form
      k=0
      Function DrawPixelForm.Click {
            Title "Rosetta Code Example", abs(k)
            if k then show
            k~
      }
      Method DrawPixelForm, "Show", 1
      Declare DrawPixelForm Nothing
}
CheckIt
 