Hello,
I want to count how many pixels there are in a window.
Is there another way apart from using GetPixel to access each pixel ?
Printable View
Hello,
I want to count how many pixels there are in a window.
Is there another way apart from using GetPixel to access each pixel ?
GetWindowRect will give you the dimensions of a window ( client area + non-client area) in pixels.
GetClientRect will give you the dimensions of a client are of a window in pixels.
Thanks, but i had in mind irregular shaped forms. Maybe there's a bmp function to count pixels to avoid using GetPixel. Any further help, please?
GetRegionData is the function that gets information about a region.
First get region of a form/dialog, then obtain RGNDATA.
I hop this helps.Code:HRGN rgn;
if(GetWindowRgn(hDlg, rgn)) {
RGNDATA rd;
GetRegionData(rgn, sizeof(RGNDATA), &rd);
DWORD nRects = rd.rdh.nCount; //I think this is what you want
}
regards
edit
Thank you very much !!
I'll try to extract every rectangle from the RGNDATA buffer that contains the RECT structures
regards