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