[Library] dxsc (DirectX 9 ScreenCaptue) [Windows x86 & x64]

Du brauchst Grafiken, gute Programme oder Leute die dir helfen? Frag hier.
Benutzeravatar
Mijikai
Beiträge: 754
Registriert: 25.09.2016 01:42

[Library] dxsc (DirectX 9 ScreenCaptue) [Windows x86 & x64]

Beitrag von Mijikai »

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

Viel Spaß damit :)

Beispiel:

Code: Alles auswählen

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/zcb6vdnxnkuhe ... L.zip?dl=0
Alternativ gib es ein GDI ScreenCapture Module (Source): viewtopic.php?f=8&t=30397