Number of Pixels in a form?
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 ?
[139 byte] By [
chals1] at [2007-11-20 10:51:20]

# 1 Re: Number of Pixels in a form?
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.
# 2 Re: Number of Pixels in a form?
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?
chals1 at 2007-11-9 13:33:24 >

# 3 Re: Number of Pixels in a form?
GetRegionData is the function that gets information about a region.
First get region of a form/dialog, then obtain RGNDATA.
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
}
I hop this helps.
regards