|
-
September 19th, 2007, 10:41 AM
#1
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 ?
-
September 19th, 2007, 11:30 AM
#2
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.
-
September 19th, 2007, 12:05 PM
#3
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?
-
September 25th, 2007, 02:39 AM
#4
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.
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
}
I hop this helps.
regards
-
September 25th, 2007, 11:16 AM
#5
Re: Number of Pixels in a form?
-
September 25th, 2007, 11:17 AM
#6
Re: Number of Pixels in a form?
Thank you very much !!
I'll try to extract every rectangle from the RGNDATA buffer that contains the RECT structures
regards
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|