[DEMO] A screenshot of SDL + Cairo + Morph

Todd Fleming todd at flemingcnc.com
Sun Dec 4 16:34:00 PST 2005


I fixed my refactored code and grabbed this screenshot:



This is generated by the following:
morph@(ContextMorph traits) paint
[
    inform: 'ContextMorph paint'.
   
    morph context `>> [
        sourceRGB: (Color r: 0 g: 0 b: 0).
        rectangle: (Rectangle origin: 0 , 0 extent: 640 , 480). fill.
       
        sourceRGB: (Color r: 1 g: 1 b: 1).
        rectangle: (Rectangle origin: 50 , 50 extent: 300 , 300). fill.
       
        sourceRGB: (Color r: 1 g: 0 b: 0).
        rectangle: (Rectangle origin: 100 , 100 extent: 100 , 100). fill.
       
        sourceRGB: (Color r: 0 g: 1 b: 0) alpha: 0.5.
        rectangle: (Rectangle origin: 150 , 150 extent: 100 , 100). fill.
       
        sourceRGB: (Color r: 0 g: 0 b: 1) alpha: 0.5.
        rectangle: (Rectangle origin: 200 , 200 extent: 100 , 100). fill.

        sourceRGB: (Color r: 1 g: 0 b: 0).
        rectangle: (Rectangle origin: 300 , 100 extent: 100 , 100). fill.
        lineWidth: 10. sourceRGB: (Color r: 0 g: 0 b: 1).
        rectangle: (Rectangle origin: 300 , 100 extent: 100 , 100). stroke.

        lineWidth: 5. sourceRGB: (Color r: 1 g: 1 b: 1).
        save.
        lineWidth: 10. sourceRGB: (Color r: 1 g: 0 b: 0).
        moveTo: 500, 100. lineTo: 600, 200. stroke.
        restore.
        moveTo: 500, 100. lineTo: 600, 200. stroke.
       
        sourceRGB: (Color r: 1 g: 0 b: 0).
        moveTo: 500, 400. lineTo: 550, 300. lineTo: 600, 400.
        lineTo: 500, 325. lineTo: 600, 325. closePath. stroke.
        sourceRGB: (Color r: 1 g: 1 b: 1).
        moveTo: 500, 400. lineTo: 550, 300. lineTo: 600, 400.
        lineTo: 500, 325. lineTo: 600, 325. fill.
    ].
].

Todd

-------------- next part --------------
Skipped content of type multipart/related


More information about the Slate mailing list