The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to speed up set pixel bitmap?
#1
[moved from General]

I'm curious about how the scan and wait functions work. they can work in the background and quickly find images even in windows that don't support PrintWindow.

I tried to make a function that can capture the screen in a window that runs in the background, but this window does not support PrintWindow. it will only get black

after I did some research, I found the SetPixel function in gdi32.dll. with this reference I can declare the dll function in my macros, then I use this to get every pixel in the area in the window.

but I think this method is too slow when compared to scan, wait, or CaptureImageOnScreen. to get 155 x 37 image I need up to 3 seconds to complete it, whereas CaptureImageOnScreen can be finished in less than 1 second

how can i speed up the process of this function?

Thanks

Function BackgroundScreenshot
Code:
Copy      Help
function hwnd x y width height str'path

dll gdi32 #SetPixel hdc x y color

RECT r
r.left = x
r.top = y
r.right = x + width
r.bottom = y + height
__MemBmp m.Create(width height)

int i j
for(j r.top r.bottom)
,for(i r.left r.right)
,,_i=FastPixel(i j hwnd 1)
,,SetPixel m.dc (i - r.left) (j - r.top) _i
SaveBitmap(m.bm path)


Messages In This Thread
How to speed up set pixel bitmap? - by zalan - 05-13-2020, 02:29 AM
SOLVED - by zalan - 05-13-2020, 05:09 AM
RE: How to speed up set pixel bitmap? - by zalan - 05-16-2020, 05:07 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)