Closed hyaray closed 1 month ago
Hi, thanks for taking a look though the code.
The main difference is that hBitmap is used by GDI and pBitmap is used by GDI+. However, you do not have access to the pixels with both hBitmap and pBitmap. Therefore, I created BitmapBuffer to help users who want access to pixels.
Initially, I thought that just returning a buffer with the pixel data was good enough. However, I realized that people would have trouble running pixelsearch and imagesearch, so I wrote the machine code to help them.
You should only use BitmapBuffer if you need access to pixels. Otherwise it is much faster to use either hBitmap or pBitmap.
what I know is: use
pBitmap
: has source from rect of screent, file, clipboard and so on, usehBitmap
: no clear source, create byCreateDIBSection
pBitmap
andhBitmap
can covert to each other.I see
BitmapBuffer
in your code, why use this?put_window
useCreateWindowEx
instead ofgui
. too much doubt...BTW, I write a funtion for
crop
to get new postion by width, fyi ^_^