Guidance
指路人
g.yi.org
software / rapidq / Examples / Graphics & Animation / Coordinate.bas

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

  
' From: "Marco" Mon, 26 Aug 2002 13:08:19 +0200
' Qcanvas
' the left upper corner of the canvas=0,0 the upperleft corner of canvas=0,0 wherever it is on the screen.
' For a rect you must give the upperleft and rightbottom coordinates.
' The easiest way to get the coordinates is to use the mouse events.

' From: "cyberrbtmail" Tue, 27 Aug 2002 02:04:47 -0000
' Screen.MouseX and Y return the cursor position relative to the entire
' desktop screen.  You have two quick alternatives: (1) use the
' ScreenToClient API function, or (2) instead of OnClick, use OnMouseUp
' which has the client X and Y coordinates as event parameters.

     DECLARE SUB can_mousedown(butt AS INTEGER,x AS INTEGER,y AS INTEGER,sh AS INTEGER)
     CREATE form AS QFORM
      center
      COLOR= 0
      CREATE canvas AS QCANVAS
       onmousedown=can_mousedown
       width = form.clientwidth
       height = form.clientheight
      END CREATE
     END CREATE
     form.SHOWMODAL
     SUB can_mousedown(butt AS INTEGER,x AS INTEGER,y AS INTEGER,sh AS INTEGER)
      canvas.fillrect(x-10,y-10,x+10,y+10,&h00ff00)
     END SUB
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-10-12  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-08-28 07:07:40