PureBoard
http://forums.purebasic.com/german/

[Library] dxsc (DirectX 9 ScreenCaptue) [Windows x86 & x64]
http://forums.purebasic.com/german/viewtopic.php?f=10&t=30893
Seite 1 von 1

Autor:  Mijikai [ 30.06.2018 19:46 ]
Betreff des Beitrags:  [Library] dxsc (DirectX 9 ScreenCaptue) [Windows x86 & x64]

dxsc ist eine kleine DirectX 9 ScreenCapture Library um den Desktop aufzunehmen.

Viel SpaƟ damit :)

Beispiel:
Code:
Import "dxsc64.lib"
  dxscInit.i(hWnd.i)    ;init directx 9 & screen capture
  dxscWidth.i()         ;get capture width (screen)
  dxscHeight.i()        ;get capture height (screen)
  dxscFrame.i()         ;capture frame to memory (returns abgr buffer)
  dxscPixel.i(X.i,Y.i)  ;get the xy pixel color within a frame (returns rgb)
  dxscSaveBMP.i(File.s) ;make a screenshot and save it as bmp
  dxscSaveJPG.i(File.s) ;make a screenshot and save it as jpg
  dxscSavePNG.i(File.s) ;make a screenshot and save it as png
  dxscRelease.i()       ;release all resources
  dxscVersion.i()       ;version (x.x.x.x)
EndImport

Global Width.i
Global Height.i
Global *Buffer
Global PosX.i
Global PosY.i
Global Event.i

If InitSprite()
  If OpenWindow(0,#Null,#Null,400,400,#Null$,#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
    If OpenWindowedScreen(WindowID(0),#Null,#Null,400,400)
      If dxscInit(WindowID(0))
        Width = dxscWidth()
        Height = dxscHeight()
        Repeat
          Repeat
            Event = WindowEvent()
            If Event = #PB_Event_CloseWindow
              Break 2
            EndIf
          Until Event = #Null
          ClearScreen(0)
          *Buffer = dxscFrame()
          If *Buffer
            If StartDrawing(ScreenOutput())
              For PosX = 0 To 399
                For PosY = 0 To 399
                  Plot(PosX,PosY,dxscPixel(PosX,PosY));slow drawing!
                Next
              Next
              StopDrawing()
            EndIf
          EndIf
          FlipBuffers()
        ForEver
        dxscRelease()
      EndIf
    EndIf
  EndIf
EndIf

Die Library ist hier zu finden (Binary): https://www.dropbox.com/s/zcb6vdnxnkuheh1/PB_5.62_dxsc_DLL.zip?dl=0
Alternativ gib es ein GDI ScreenCapture Module (Source): https://www.purebasic.fr/german/viewtopic.php?f=8&t=30397

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde [ Sommerzeit ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/