DrawPixmap( desktopPixMap, 0, 0 )
Local DeskTopImage:TImage = LoadImage(desktopPixMap)
Local DesktopImage:TImage = LoadImage(ScreenCapture())
Local DeskTopImage:TImage = LoadAnimImage(ScreenCapture(),TileWidth,TileHeight,0,CellWidth*CellHeight)
Import pub.win32SuperStrict Extern "win32" Function ReleaseDC:Int(hwnd:Int,hdc:Int) Function GetPixel:Int(hdc:Int,x:Int,y:Int)End ExternConst SRCCOPY:Int = $CC0020Function GrabScreen:TPixmap(x:Int=0,y:Int=0,width:Int=0,height:Int=0) Local hdc:Int = GetDC(Null) If width <= 0 Then width = 100000000000 If height <= 0 Then height = 100000000000 Local maxWidth:Int = GetDeviceCaps(hdc,HORZRES)-x Local maxHeight:Int = GetDeviceCaps(hdc,VERTRES)-y width = Min(maxWidth,width) height = Min(maxHeight,height) Local newHdc:Int = CreateCompatibleDC(hdc) If newHdc = 0 Then Return Null Local newBmp:Int = CreateCompatibleBitmap(hdc,width,height) If newBmp = 0 ReleaseDC(Null,newHdc) Return Null EndIf If SelectObject(newHdc, newBmp) = False Return Null EndIf If BitBlt(newHdc,0,0,width,height,hdc,x,y,SRCCOPY) = False Return Null EndIf Local pixmap:TPixmap = CreatePixmap(width,height,PF_RGBA8888) For Local y:Int = 0 Until height For Local x:Int = 0 Until width Local pixel:Int = GetPixel(newHdc,x,y) WritePixel(pixmap,x,y,$FF000000+(pixel & $ff) Shl 16 + (pixel & $ff00) + (pixel & $ff0000) Shr 16) Next Next DeleteObject(newBmp) ReleaseDC(Null,newHdc) Return pixmapEnd Function