Click to See Complete Forum and Search --> : Number of Pixels in a form?
chals1
September 19th, 2007, 11:41 AM
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 ?
kirants
September 19th, 2007, 12:30 PM
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.
chals1
September 19th, 2007, 01:05 PM
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?
Ali Imran
September 25th, 2007, 03:39 AM
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
chals1
September 25th, 2007, 12:16 PM
edit
chals1
September 25th, 2007, 12:17 PM
Thank you very much !!
I'll try to extract every rectangle from the RGNDATA buffer that contains the RECT structures
regards
codeguru.com
Copyright 2007 Jupitermedia Corporation All Rights Reserved.