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

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

  
'from: "gerson.gitahy"  Thu, 30 Oct 2003 18:37:45 -0300

' InvertDeskTop

     $INCLUDE "Rapidq.inc"
     $TYPECHECK ON
     DECLARE FUNCTION GetDesktopWindow LIB "user32"
     ALIAS "GetDesktopWindow" () AS LONG
     DECLARE FUNCTION GetDC LIB "user32" ALIAS "GetDC" (BYVAL hwnd AS _
      LONG) AS LONG
'Declare Function ReleaseDC Lib "user32" Alias "ReleaseDC" (ByVal hwnd As Long, ByVal hdc As Long) As Long
     DECLARE FUNCTION StretchBlt LIB "gdi32" ALIAS "StretchBlt" _
      (BYVAL hdc AS LONG, _
      BYVAL x AS LONG, _
      BYVAL y AS LONG, _
      BYVAL nWidth AS LONG, _
      BYVAL nHeight AS LONG, _
      BYVAL hSrcDC AS LONG, _
      BYVAL xSrc AS LONG, _
      BYVAL ySrc AS LONG, _
      BYVAL nSrcWidth AS LONG, _
      BYVAL nSrcHeight AS LONG, _
      BYVAL dwRop AS LONG) AS LONG
     CONST SRCCOPY = &HCC0020
     CONST SRCAND = &H8800C6
     CONST SRCINVERT = &H660046

     DIM Bitmap AS QBITMAP
     Bitmap.Width = Screen.Width
     Bitmap.Height = Screen.Height
     Bitmap.PixelFormat = pf24bit
     DECLARE SUB Form_Load (Form AS QFORM)
     DECLARE SUB Form_Paint (Sender AS QFORM)
     DECLARE SUB Form_KeyDown
     CREATE form AS QFORM
      Width = Screen.Width
      Height = Screen.Height
      BorderStyle=bsNone
      Hint = "Press a Key to exit"
      ShowHint = True
      OnShow = Form_Load
      OnPaint = Form_Paint
      OnKeyDown = Form_KeyDown
      Center
      CREATE Image AS QIMAGE
       Width=Form.ClientWidth
       Height=Form.ClientHeight
       AutoSize=1
       Stretch = True
       BMP=Image.BMP
      END CREATE
      SHOWMODAL
     END CREATE
     SUB Form_Load
      DIM a AS LONG
      DIM b AS LONG
      a = GetDesktopWindow()
      b = GetDC(a)
      StretchBlt(Bitmap.Handle, 0, 0, Screen.Width, Screen.Height, b, 0, _
       Screen.Height, Screen.Width, -Screen.Height, SRCCOPY)
'ReleaseDC(0,b)
      Image.BMP=Bitmap.BMP
     END SUB
     SUB Form_Paint
      DIM R AS QRECT
      R.Left = Image.Left 'or 0
      R.Top = Image.Top 'or 0
      R.Right = Image.Width
      R.Bottom = Image.Height
      Sender.StretchDraw(R, Image.BMP)
     END SUB

     SUB Form_KeyDown(KeyCode AS INTEGER, Shift AS INTEGER)
      END
     END SUB
掌柜推荐
 
 
¥860.00 ·
 
 
¥410.00 ·
 
 
¥288.00 ·
 
 
¥918.00 ·
 
 
¥288.00 ·
 
 
¥264.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2003-10-31 09:02:17