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

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

  
'by "Jonathan Boles"


     CONST CCHDEVICENAME = 32
     CONST CCHFORMNAME = 32

     TYPE DEVMODE
      dmDeviceName AS STRING * CCHDEVICENAME
      dmSpecVersion AS INTEGER
      dmDriverVersion AS INTEGER
      dmSize AS INTEGER
      dmDriverExtra AS INTEGER
      dmFields AS LONG
      dmOrientation AS INTEGER
      dmPaperSize AS INTEGER
      dmPaperLength AS INTEGER
      dmPaperWidth AS INTEGER
      dmScale AS INTEGER
      dmCopies AS INTEGER
      dmDefaultSource AS INTEGER
      dmPrintQuality AS INTEGER
      dmColor AS INTEGER
      dmDuplex AS INTEGER
      dmYResolution AS INTEGER
      dmTTOption AS INTEGER
      dmCollate AS INTEGER
      dmFormName AS STRING * CCHFORMNAME
      dmUnusedPadding AS INTEGER
      dmBitsPerPel AS LONG
      dmPelsWidth AS LONG
      dmPelsHeight AS LONG
      dmDisplayFlags AS LONG
      dmDisplayFrequency AS LONG
     END TYPE

     DECLARE FUNCTION GetDesktopWindow LIB "user32" ALIAS "GetDesktopWindow" () AS LONG
     DECLARE FUNCTION CreateDC LIB "gdi32" ALIAS "CreateDCA" (BYVAL lpDriverName AS STRING _
      , BYVAL lpDeviceName AS STRING, BYVAL lpOutput AS STRING, lpInitData AS DEVMODE) AS LONG
     DECLARE FUNCTION BitBlt LIB "gdi32.dll" ALIAS "BitBlt" (BYVAL hdcDest AS LONG, BYVAL _
      nXDest AS LONG, BYVAL nYDest AS LONG, BYVAL nWidth AS LONG, BYVAL nHeight AS LONG _
      , BYVAL hdcSrc AS LONG, BYVAL nXSrc AS LONG, BYVAL nYSrc AS LONG, BYVAL dwRop AS LONG) AS LONG

     DIM Bitmap AS QBITMAP, DeskhWnd AS LONG, DeskDC AS LONG

     DeskhWnd=GetDesktopWindow()
     DeskDC = CreateDC("DISPLAY", "", "", DevThing)
     Bitmap.Height=Screen.Height
     Bitmap.Width=Screen.Width
     BitBlt(Bitmap.Handle,1,1,Screen.Width,Screen.Height,DeskDC,1,1,&HCC0020)
     Bitmap.SaveToFile("screenshot.bmp")
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2023-2-9  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:46:55