Bug 455927 - StatusBarPanel: Icon has wrong image size
Summary: StatusBarPanel: Icon has wrong image size
Status: REOPENED
Alias: None
Product: UI Automation
Classification: Mono
Component: Winforms - General (show other bugs)
Version: Release 0.9
Hardware: x86 openSUSE 11.0
: P4 - Low : Normal
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-03 09:26 UTC by calen chen
Modified: 2009-03-04 23:50 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description calen chen 2008-12-03 09:26:28 UTC
PROBLEM STATEMENT:

StatusBarPanel3 with Icon property which can display image in statusbar, but in accerciser, under "Image" tab, Size shows "53x22", I think that is the size of panel not the size of icon, in this example the icon's size is "32x32"

REPRO:

1. run accerciser
2. run uia2atk/test/samples/statusbarpanel.py
3. in accerciser left tree, select last item "icon" with "panel" role name under
statusbar, which is statusbarpanel3 with Icon property
4. see "Image" under "interface viewer"

RESULTS:

under "Image" tab, Size shows 53x22 that is the same as the Size showing under "Component"

EXPECTED RESULTS:

I think in Image tab under "interface viewer", the Size should shows icon's exact size, here in the example the icon's size is "32*32", in Component tab, the Size should shows panel's size
Comment 1 calen chen 2008-12-03 09:27:03 UTC
the test due 12/03, i give it P1 priority. thanks!
Comment 2 Sanford Armstrong 2008-12-03 14:09:40 UTC
Working on this. :-)
Comment 3 Sanford Armstrong 2008-12-03 14:24:24 UTC
In r120596 of UIAutomationWinforms, the size is fixed, but I need to spend some time still on the position.  Is position important to your tests?
Comment 4 Sanford Armstrong 2008-12-03 15:35:40 UTC
Well, closing this bug, as it's about size, not position.  :-)  But still I'll fix position today.
Comment 5 calen chen 2008-12-04 03:25:38 UTC
Hi Sandy, there is still a problem about size, I updated my example(samples/statusbarpanel.py) that panel1 with 16x16 size icon, panel2 with 48x48 size icon, panel3 still with 32x32 size icon. panel1 and panel3 now can get correct size showing in Image tab, but panel2(48x48) also shows 32x32 size, seems 32x32 is the maximum size for icon to show. please take look again, thanks! also thanks you are working on position issue although is hard for me to test because I am not sure the expected position(x,y) :(
Comment 6 Sanford Armstrong 2008-12-04 13:42:20 UTC
My position fix wasn't entirely ready, but I committed in r120690 (UIAutomationWinforms) anyway.  It works great for default alignment but if you do this, for example...

self.statusbarpanel3.Alignment = HorizontalAlignment.Right

...the positioning will be off by several pixels.

As for the size, well, it looks like 32x32 is the maximum icon size.  If I add this line to your test...

print self.statusbarpanel2.Icon.Width

...it prints "32".

So to summarize:
1) 32x32 is the maximum icon size for some reason, and
2) If you don't change the alignment, positioning should now work fine.

Closing bug again...but please feel free to re-open if I'm missing something else!  Thanks for your thorough testing.
Comment 7 calen chen 2008-12-04 14:29:53 UTC
Sandy, sorry i reopen it again, because after I update to r120699 it's too difficult to select panel items under "status bar" roll from accerciser left tree , seems the fix affect performance, please take a look, thanks :)
Comment 8 Sanford Armstrong 2008-12-04 16:11:49 UTC
Calen, you are correct.  It is not consistent so I did not catch it in my tests, but I do see what the problem is, and I am working to solve it.
Comment 9 calen chen 2008-12-04 16:17:40 UTC
(In reply to comment #7 from calen chen)
> Sandy, sorry i reopen it again, because after I update to r120699 it's too
> difficult to select panel items under "status bar" roll from accerciser left
> tree , seems the fix affect performance, please take a look, thanks :)
> 

it's not performance problem, I just noticed if you select label items under "status bar" in accerciser left tree,  you should move your mouse through application GUI window, then the label item would be selected.

I didn't found any answer from MSDN why icon's maximum size is 32x32, do you think it is our program's bug?
Comment 10 Sanford Armstrong 2008-12-04 16:33:19 UTC
(In reply to comment #9 from calen chen)
> it's not performance problem, I just noticed if you select label items under
> "status bar" in accerciser left tree,  you should move your mouse through
> application GUI window, then the label item would be selected.

Yes, I know, it is hanging on my call to CreateGraphics, though that is supposed to be thread-safe.

> I didn't found any answer from MSDN why icon's maximum size is 32x32, do you
> think it is our program's bug?

MSDN says it's a system-determined size, so I don't really know.  The weird thing to me is that all of the icons appear to be the exact same size to me anyway (16x16) in the actual GUI.
Comment 11 Sanford Armstrong 2008-12-04 16:43:47 UTC
Fixed in r120726 of UIAutomationWinforms, as far as I can tell.
Comment 12 calen chen 2008-12-12 05:45:59 UTC
Closed in trunk r121400.

when I used Eye of GNOME application to view statusbarpanel2's warn.icon I got 48x48 size showing, so I misunderstand the icon is 48x48 pixel. in face the icon is 32x32 pixel showing in Vista and checking by "#file warn.icon". I updated an actual 48x48 pixel icon for statusbarpanel example.
Comment 13 calen chen 2009-03-03 02:58:06 UTC
Reopened in mono-uia-127318-257 uiaatkbridge-127363-584 uiautomationwinforms-127335-609:

All images is showing with wrong (-1x-1) size in accerciser. the exactly size should be (16x16)(48x48)(32x32)
Comment 14 Brad Taylor 2009-03-04 16:56:10 UTC
Reducing priority as it's only an image size issue.