Guidance
指路人
g.yi.org
software / rapidq / Examples / Graphics & Animation / canvas demo.rqb

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
     $OPTIMIZE ON
     $TYPECHECK ON
     $INCLUDE "rapidq.inc"
     $ESCAPECHARS ON

     DECLARE SUB Canvas_OnPaint
     DECLARE SUB Canvas_OnClick

     CREATE Form AS QFORM
      Height = 200
      Width = 200
      BorderStyle = bsNone
      Center
      CREATE Canvas AS QCANVAS
       Top = 0
       Left = 0
       Height = 200
       Width = 200
       OnPaint = Canvas_OnPaint
       OnClick = Canvas_OnClick
      END CREATE
     END CREATE

     Canvas.RePaint
     Form.SHOWMODAL

     SUB Canvas_OnPaint
      DIM x% AS INTEGER, y% AS INTEGER

      FOR x% = 0 TO Canvas.Width
       FOR y% = 0 TO Canvas.Height
        Canvas.PSet(x%, y%, RGB(RND(256), RND(256), RND(256)))
			'Remember the RapidQ colors are in BGR format. This function converts properly...
       NEXT y%
      NEXT x%
     END SUB

     SUB Canvas_OnClick
      IF MESSAGEDLG("Again?", mtConfirmation, mbYes OR mbNo, -1) = mrYes THEN
       Canvas.RePaint
      ELSE
       END
      END IF
     END SUB
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-10-12  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-12-23 20:11:30