all groups > dotnet compact framework > october 2005 >
You're in the dotnet compact framework group:
AutoScale not working
dotnet compact framework:
[quoted text, click to view] Michael Coelsch wrote: > When i create a Form in VS 2005 (VB.NET), the designer shows all controls > (Picture Boxes, ...) correctly in a form (240x320 pixel). > But when i deploy to a VGA device or the VGA emulator, all controls to not > autoscaled and appear very small in the top left quarter corner of the > screen. > > What can i do? > > Autoscale mode of the form is set to DPI. > > I have an english VS.NET 2005 on a german Win XP machine. > > Thanks > Michael > >
if Autoscaled mode is not work,I suggest that you write some code to recognize wether it is VGA device before all controls initialize.Usually My app does not choose AutoScaled mode.It is the same reason that
When i create a Form in VS 2005 (VB.NET), the designer shows all controls (Picture Boxes, ...) correctly in a form (240x320 pixel). But when i deploy to a VGA device or the VGA emulator, all controls to not autoscaled and appear very small in the top left quarter corner of the screen. What can i do? Autoscale mode of the form is set to DPI. I have an english VS.NET 2005 on a german Win XP machine. Thanks Michael
It has some layout capabilities to *assist* with that, but there's no general method of just making things work that would make sense for all applications. Paul T. [quoted text, click to view] "Michael Coelsch" <mcoelsch@community.nospam> wrote in message news:%236QCgrs3FHA.1148@tk2msftngp13.phx.gbl... > Hi, > > i thought VS 2005 would take care about resizing controls (especially > picture boxes) automatically for VGA and QVGA support?? > > What can i do? > > The controls location is OK, but the picture in the picture-box is not > autoscaled to QVGA resolution! > > Michael > > > "Paker Liu" <lsj_1212@163.com> schrieb im Newsbeitrag > news:eeMxO8n3FHA.1416@TK2MSFTNGP09.phx.gbl... >> Michael Coelsch wrote: >> >>> When i create a Form in VS 2005 (VB.NET), the designer shows all >>> controls (Picture Boxes, ...) correctly in a form (240x320 pixel). >>> But when i deploy to a VGA device or the VGA emulator, all controls to >>> not autoscaled and appear very small in the top left quarter corner of >>> the screen. >>> >>> What can i do? >>> >>> Autoscale mode of the form is set to DPI. >>> >>> I have an english VS.NET 2005 on a german Win XP machine. >>> >>> Thanks >>> Michael >>> >>> >> if Autoscaled mode is not work,I suggest that you write some code to >> recognize wether it is VGA device before all controls initialize.Usually >> My app does not choose AutoScaled mode.It is the same reason that >> Autoscaled mode is not well work! > >
Hi, i thought VS 2005 would take care about resizing controls (especially picture boxes) automatically for VGA and QVGA support?? What can i do? The controls location is OK, but the picture in the picture-box is not autoscaled to QVGA resolution! Michael "Paker Liu" <lsj_1212@163.com> schrieb im Newsbeitrag news:eeMxO8n3FHA.1416@TK2MSFTNGP09.phx.gbl... [quoted text, click to view] > Michael Coelsch wrote: > >> When i create a Form in VS 2005 (VB.NET), the designer shows all controls >> (Picture Boxes, ...) correctly in a form (240x320 pixel). >> But when i deploy to a VGA device or the VGA emulator, all controls to >> not autoscaled and appear very small in the top left quarter corner of >> the screen. >> >> What can i do? >> >> Autoscale mode of the form is set to DPI. >> >> I have an english VS.NET 2005 on a german Win XP machine. >> >> Thanks >> Michael >> >> > if Autoscaled mode is not work,I suggest that you write some code to > recognize wether it is VGA device before all controls initialize.Usually > My app does not choose AutoScaled mode.It is the same reason that > Autoscaled mode is not well work!
Is there any way to make it work the same way it did in VS 2003? I have an app I have been developing using a VGA device, and it always just scaled everything for me under CF 1.0. Now I have upgraded the project to CF 2.0 and I cannot get it to behave the same way! [quoted text, click to view] Paul G. Tobey [eMVP] wrote: > It has some layout capabilities to *assist* with that, but there's no > general method of just making things work that would make sense for all > applications. > > Paul T. > > "Michael Coelsch" <mcoelsch@community.nospam> wrote in message > news:%236QCgrs3FHA.1148@tk2msftngp13.phx.gbl...
I have also found this very frustrating. I have found that in addition to setting AutoScaleMode=dpi you need to set AutoScaleBaseSize. If you create a new form/control in VS 2005 it seems to set these properties by default, however I have had to add them when migrating from a VS2003 project. Having done this most controls appear ok, however images (including those on listviews and toolbars) do not get scaled. I do not know any way to get this done automatically so I think I will have to write additional code to test the screen resolution and scale the images myself. Does anyone have a better idea? This is frustrating as I like all the other benefits that VS2005 brings. Stuart Eastland [quoted text, click to view] Paul Moon wrote: > Is there any way to make it work the same way it did in VS 2003? I have > an app I have been developing using a VGA device, and it always just > scaled everything for me under CF 1.0. Now I have upgraded the project > to CF 2.0 and I cannot get it to behave the same way!
VS2005 does not scale icons in imagelists as used for ListView controls and Toolbar controls. Unfortunately you have to code for it, then test on VGA and QVGA devices/emulators. At first this seems like a pain but when you think about it it is quite resonable as you might want to use 48x48 under LargeIcon view in a listview not whatever the factor for the form might be. In VGA devices (192 dpi) this will be 32*192/96 = 64. Cheers Simon. [quoted text, click to view] "eastlands" <eastlands@rightfile.com> wrote in message news:1134639039.480355.65190@f14g2000cwb.googlegroups.com... >I have also found this very frustrating. I have found that in addition > to setting AutoScaleMode=dpi you need to set AutoScaleBaseSize. > > If you create a new form/control in VS 2005 it seems to set these > properties by default, however I have had to add them when migrating > from a VS2003 project. > > Having done this most controls appear ok, however images (including > those on listviews and toolbars) do not get scaled. I do not know any > way to get this done automatically so I think I will have to write > additional code to test the screen resolution and scale the images > myself. Does anyone have a better idea? > > This is frustrating as I like all the other benefits that VS2005 > brings. > > Stuart Eastland > > > Paul Moon wrote: > >> Is there any way to make it work the same way it did in VS 2003? I have >> an app I have been developing using a VGA device, and it always just >> scaled everything for me under CF 1.0. Now I have upgraded the project >> to CF 2.0 and I cannot get it to behave the same way! >
VS2003 didn't handle scaling icons. VS2005 works the same as VS2003. You still have to specify the size of the imagelist in both 2003 and 2005. It would have been nice for VS2005 to automatically change the size of the toolbar imagelist as when running in hidpi you want to use 32x32 not 16x16. Cheers Simon. [quoted text, click to view] "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message news:%236VeX5dAGHA.2536@TK2MSFTNGP09.phx.gbl... > Simon, > > Reasonable - but still a bloody pain to have to do all this, when VS2003 > handled it all automatically. > > Every dynamically added control requires scaling and then testing on both > devices. That's a fair amount of testing, just to convert an app to > VS2005 - eh? > > There are plenty of other "gottchas" too. Well it least it gives you a > chance to review your code and that can't be all bad. > > Graham > > > "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message > news:OoTtL9bAGHA.2080@TK2MSFTNGP10.phx.gbl... >> VS2005 does not scale icons in imagelists as used for ListView controls >> and Toolbar controls. Unfortunately you have to code for it, then test on >> VGA and QVGA devices/emulators. >> >> At first this seems like a pain but when you think about it it is quite >> resonable as you might want to use 48x48 under LargeIcon view in a >> listview not whatever the factor for the form might be. In VGA devices >> (192 dpi) this will be 32*192/96 = 64. >> >> Cheers >> Simon. >> >> >> "eastlands" <eastlands@rightfile.com> wrote in message >> news:1134639039.480355.65190@f14g2000cwb.googlegroups.com... >>>I have also found this very frustrating. I have found that in addition >>> to setting AutoScaleMode=dpi you need to set AutoScaleBaseSize. >>> >>> If you create a new form/control in VS 2005 it seems to set these >>> properties by default, however I have had to add them when migrating >>> from a VS2003 project. >>> >>> Having done this most controls appear ok, however images (including >>> those on listviews and toolbars) do not get scaled. I do not know any >>> way to get this done automatically so I think I will have to write >>> additional code to test the screen resolution and scale the images >>> myself. Does anyone have a better idea? >>> >>> This is frustrating as I like all the other benefits that VS2005 >>> brings. >>> >>> Stuart Eastland >>> >>> >>> Paul Moon wrote: >>> >>>> Is there any way to make it work the same way it did in VS 2003? I >>>> have >>>> an app I have been developing using a VGA device, and it always just >>>> scaled everything for me under CF 1.0. Now I have upgraded the project >>>> to CF 2.0 and I cannot get it to behave the same way! >>> >> >> > >
This is because 2003 double buffers the screen when deploying a non-dpi aware app on a hires device. Cheers Simon. [quoted text, click to view] "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message news:uUvhK1mAGHA.1124@TK2MSFTNGP10.phx.gbl... > Simon, > > I must have got away with something then in 2003. My icons look just right > when I deploy the 2003 app to either device. > > Graham > > > "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message > news:uQcwXviAGHA.2912@tk2msftngp13.phx.gbl... >> VS2003 didn't handle scaling icons. VS2005 works the same as VS2003. You >> still have to specify the size of the imagelist in both 2003 and 2005. >> >> It would have been nice for VS2005 to automatically change the size of >> the toolbar imagelist as when running in hidpi you want to use 32x32 not >> 16x16. >> >> Cheers >> Simon. >> >> "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message >> news:%236VeX5dAGHA.2536@TK2MSFTNGP09.phx.gbl... >>> Simon, >>> >>> Reasonable - but still a bloody pain to have to do all this, when VS2003 >>> handled it all automatically. >>> >>> Every dynamically added control requires scaling and then testing on >>> both devices. That's a fair amount of testing, just to convert an app to >>> VS2005 - eh? >>> >>> There are plenty of other "gottchas" too. Well it least it gives you a >>> chance to review your code and that can't be all bad. >>> >>> Graham >>> >>> >>> "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message >>> news:OoTtL9bAGHA.2080@TK2MSFTNGP10.phx.gbl... >>>> VS2005 does not scale icons in imagelists as used for ListView controls >>>> and Toolbar controls. Unfortunately you have to code for it, then test >>>> on VGA and QVGA devices/emulators. >>>> >>>> At first this seems like a pain but when you think about it it is quite >>>> resonable as you might want to use 48x48 under LargeIcon view in a >>>> listview not whatever the factor for the form might be. In VGA devices >>>> (192 dpi) this will be 32*192/96 = 64. >>>> >>>> Cheers >>>> Simon. >>>> >>>> >>>> "eastlands" <eastlands@rightfile.com> wrote in message >>>> news:1134639039.480355.65190@f14g2000cwb.googlegroups.com... >>>>>I have also found this very frustrating. I have found that in addition >>>>> to setting AutoScaleMode=dpi you need to set AutoScaleBaseSize. >>>>> >>>>> If you create a new form/control in VS 2005 it seems to set these >>>>> properties by default, however I have had to add them when migrating >>>>> from a VS2003 project. >>>>> >>>>> Having done this most controls appear ok, however images (including >>>>> those on listviews and toolbars) do not get scaled. I do not know any >>>>> way to get this done automatically so I think I will have to write >>>>> additional code to test the screen resolution and scale the images >>>>> myself. Does anyone have a better idea? >>>>> >>>>> This is frustrating as I like all the other benefits that VS2005 >>>>> brings. >>>>> >>>>> Stuart Eastland >>>>> >>>>> >>>>> Paul Moon wrote: >>>>> >>>>>> Is there any way to make it work the same way it did in VS 2003? I >>>>>> have >>>>>> an app I have been developing using a VGA device, and it always just >>>>>> scaled everything for me under CF 1.0. Now I have upgraded the >>>>>> project >>>>>> to CF 2.0 and I cannot get it to behave the same way! >>>>> >>>> >>>> >>> >>> >> >> > >
Simon, Reasonable - but still a bloody pain to have to do all this, when VS2003 handled it all automatically. Every dynamically added control requires scaling and then testing on both devices. That's a fair amount of testing, just to convert an app to VS2005 - eh? There are plenty of other "gottchas" too. Well it least it gives you a chance to review your code and that can't be all bad. Graham [quoted text, click to view] "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message news:OoTtL9bAGHA.2080@TK2MSFTNGP10.phx.gbl... > VS2005 does not scale icons in imagelists as used for ListView controls > and Toolbar controls. Unfortunately you have to code for it, then test on > VGA and QVGA devices/emulators. > > At first this seems like a pain but when you think about it it is quite > resonable as you might want to use 48x48 under LargeIcon view in a > listview not whatever the factor for the form might be. In VGA devices > (192 dpi) this will be 32*192/96 = 64. > > Cheers > Simon. > > > "eastlands" <eastlands@rightfile.com> wrote in message > news:1134639039.480355.65190@f14g2000cwb.googlegroups.com... >>I have also found this very frustrating. I have found that in addition >> to setting AutoScaleMode=dpi you need to set AutoScaleBaseSize. >> >> If you create a new form/control in VS 2005 it seems to set these >> properties by default, however I have had to add them when migrating >> from a VS2003 project. >> >> Having done this most controls appear ok, however images (including >> those on listviews and toolbars) do not get scaled. I do not know any >> way to get this done automatically so I think I will have to write >> additional code to test the screen resolution and scale the images >> myself. Does anyone have a better idea? >> >> This is frustrating as I like all the other benefits that VS2005 >> brings. >> >> Stuart Eastland >> >> >> Paul Moon wrote: >> >>> Is there any way to make it work the same way it did in VS 2003? I have >>> an app I have been developing using a VGA device, and it always just >>> scaled everything for me under CF 1.0. Now I have upgraded the project >>> to CF 2.0 and I cannot get it to behave the same way! >> > >
Simon, I must have got away with something then in 2003. My icons look just right when I deploy the 2003 app to either device. Graham [quoted text, click to view] "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message news:uQcwXviAGHA.2912@tk2msftngp13.phx.gbl... > VS2003 didn't handle scaling icons. VS2005 works the same as VS2003. You > still have to specify the size of the imagelist in both 2003 and 2005. > > It would have been nice for VS2005 to automatically change the size of the > toolbar imagelist as when running in hidpi you want to use 32x32 not > 16x16. > > Cheers > Simon. > > "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message > news:%236VeX5dAGHA.2536@TK2MSFTNGP09.phx.gbl... >> Simon, >> >> Reasonable - but still a bloody pain to have to do all this, when VS2003 >> handled it all automatically. >> >> Every dynamically added control requires scaling and then testing on both >> devices. That's a fair amount of testing, just to convert an app to >> VS2005 - eh? >> >> There are plenty of other "gottchas" too. Well it least it gives you a >> chance to review your code and that can't be all bad. >> >> Graham >> >> >> "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message >> news:OoTtL9bAGHA.2080@TK2MSFTNGP10.phx.gbl... >>> VS2005 does not scale icons in imagelists as used for ListView controls >>> and Toolbar controls. Unfortunately you have to code for it, then test >>> on VGA and QVGA devices/emulators. >>> >>> At first this seems like a pain but when you think about it it is quite >>> resonable as you might want to use 48x48 under LargeIcon view in a >>> listview not whatever the factor for the form might be. In VGA devices >>> (192 dpi) this will be 32*192/96 = 64. >>> >>> Cheers >>> Simon. >>> >>> >>> "eastlands" <eastlands@rightfile.com> wrote in message >>> news:1134639039.480355.65190@f14g2000cwb.googlegroups.com... >>>>I have also found this very frustrating. I have found that in addition >>>> to setting AutoScaleMode=dpi you need to set AutoScaleBaseSize. >>>> >>>> If you create a new form/control in VS 2005 it seems to set these >>>> properties by default, however I have had to add them when migrating >>>> from a VS2003 project. >>>> >>>> Having done this most controls appear ok, however images (including >>>> those on listviews and toolbars) do not get scaled. I do not know any >>>> way to get this done automatically so I think I will have to write >>>> additional code to test the screen resolution and scale the images >>>> myself. Does anyone have a better idea? >>>> >>>> This is frustrating as I like all the other benefits that VS2005 >>>> brings. >>>> >>>> Stuart Eastland >>>> >>>> >>>> Paul Moon wrote: >>>> >>>>> Is there any way to make it work the same way it did in VS 2003? I >>>>> have >>>>> an app I have been developing using a VGA device, and it always just >>>>> scaled everything for me under CF 1.0. Now I have upgraded the >>>>> project >>>>> to CF 2.0 and I cannot get it to behave the same way! >>>> >>> >>> >> >> > >
Hi Simon, Could you explain that further? The 2003 technique sounds like a simpler solution, so there must have been a good reason for going away from it in 2005. Is it quicker the new way? I keep revising the way I'm doing this and I keep finding new ways to do the same thing. But I would like to make it as efficient as possible. For my custom controls I'm swinging to handling the scaling with ScaleControl in OnParentChanged, but then you need to check who the Parent is. But that doesn't get around using g.DpiX and g.DpiY in OnPaint if you happen to adjust anything in there. Re ImageLists I now find that I need both 16x16 and 32x32. Is there a tool around that easily converts gif, icons, bmp etc. from one size to another. I've been redrawing them, which I'm not to flash at and it's taking for ever. Graham [quoted text, click to view] "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message news:%230fRuyoAGHA.3352@TK2MSFTNGP10.phx.gbl... > This is because 2003 double buffers the screen when deploying a non-dpi > aware app on a hires device. > > Cheers > Simon. > > "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message > news:uUvhK1mAGHA.1124@TK2MSFTNGP10.phx.gbl... >> Simon, >> >> I must have got away with something then in 2003. My icons look just >> right when I deploy the 2003 app to either device. >> >> Graham >> >> >> "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message >> news:uQcwXviAGHA.2912@tk2msftngp13.phx.gbl... >>> VS2003 didn't handle scaling icons. VS2005 works the same as VS2003. You >>> still have to specify the size of the imagelist in both 2003 and 2005. >>> >>> It would have been nice for VS2005 to automatically change the size of >>> the toolbar imagelist as when running in hidpi you want to use 32x32 not >>> 16x16. >>> >>> Cheers >>> Simon. >>> >>> "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message >>> news:%236VeX5dAGHA.2536@TK2MSFTNGP09.phx.gbl... >>>> Simon, >>>> >>>> Reasonable - but still a bloody pain to have to do all this, when >>>> VS2003 handled it all automatically. >>>> >>>> Every dynamically added control requires scaling and then testing on >>>> both devices. That's a fair amount of testing, just to convert an app >>>> to VS2005 - eh? >>>> >>>> There are plenty of other "gottchas" too. Well it least it gives you a >>>> chance to review your code and that can't be all bad. >>>> >>>> Graham >>>> >>>> >>>> "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message >>>> news:OoTtL9bAGHA.2080@TK2MSFTNGP10.phx.gbl... >>>>> VS2005 does not scale icons in imagelists as used for ListView >>>>> controls and Toolbar controls. Unfortunately you have to code for it, >>>>> then test on VGA and QVGA devices/emulators. >>>>> >>>>> At first this seems like a pain but when you think about it it is >>>>> quite resonable as you might want to use 48x48 under LargeIcon view in >>>>> a listview not whatever the factor for the form might be. In VGA >>>>> devices (192 dpi) this will be 32*192/96 = 64. >>>>> >>>>> Cheers >>>>> Simon. >>>>> >>>>> >>>>> "eastlands" <eastlands@rightfile.com> wrote in message >>>>> news:1134639039.480355.65190@f14g2000cwb.googlegroups.com... >>>>>>I have also found this very frustrating. I have found that in >>>>>>addition >>>>>> to setting AutoScaleMode=dpi you need to set AutoScaleBaseSize. >>>>>> >>>>>> If you create a new form/control in VS 2005 it seems to set these >>>>>> properties by default, however I have had to add them when migrating >>>>>> from a VS2003 project. >>>>>> >>>>>> Having done this most controls appear ok, however images (including >>>>>> those on listviews and toolbars) do not get scaled. I do not know >>>>>> any >>>>>> way to get this done automatically so I think I will have to write >>>>>> additional code to test the screen resolution and scale the images >>>>>> myself. Does anyone have a better idea? >>>>>> >>>>>> This is frustrating as I like all the other benefits that VS2005 >>>>>> brings. >>>>>> >>>>>> Stuart Eastland >>>>>> >>>>>> >>>>>> Paul Moon wrote: >>>>>> >>>>>>> Is there any way to make it work the same way it did in VS 2003? I >>>>>>> have >>>>>>> an app I have been developing using a VGA device, and it always just >>>>>>> scaled everything for me under CF 1.0. Now I have upgraded the >>>>>>> project >>>>>>> to CF 2.0 and I cannot get it to behave the same way! >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > >
Hi Graham, The 2003 solution was simple but under developed and didn't support hires devices such as the iPAQ h4700 which is 640x480 dpi or the iMate JasJar etc..There are still lots of new devices being manufactured that only contain QVGA screens 240x320. So with VS2005 Microsoft has added support for both types. This makes sense as you can take advantage of the nice higher resolution making your icons, text etc look nice and crisp. If you want to go back to double buffering (as per VS2003) then you can set the AutoScaleMode of class Form to None. There was also a nasty little bug in VS2003 re imagelists. It wouldn't support transparent backgrounds when adding Icons via the designer. So this had to be done via code. So it wasn't so much hardship for me to support hires as all I had to do was add additional code to change the size of the imagelist depending on the resolution, then create a bigger icon from the exiting icon stream. Supporting DPI awareness in your Controls: Why don't you just handle the GDI drawing in the OnPaint event then change each hard coded coordinate to something like: value * g.DpiY / 96. I personally always use Icons and use the Michelangelo icon editor - do a google I'm sure you'll find the site I can't remember it now. Cheers Simon. [quoted text, click to view] "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message news:e5UDb%23oAGHA.204@TK2MSFTNGP15.phx.gbl... > Hi Simon, > > Could you explain that further? The 2003 technique sounds like a simpler > solution, so there must have been a good reason for going away from it in > 2005. Is it quicker the new way? > > I keep revising the way I'm doing this and I keep finding new ways to do > the same thing. But I would like to make it as efficient as possible. > > For my custom controls I'm swinging to handling the scaling with > ScaleControl in OnParentChanged, but then you need to check who the Parent > is. But that doesn't get around using g.DpiX and g.DpiY in OnPaint if you > happen to adjust anything in there. > > Re ImageLists I now find that I need both 16x16 and 32x32. Is there a tool > around that easily converts gif, icons, bmp etc. from one size to another. > I've been redrawing them, which I'm not to flash at and it's taking for > ever. > > Graham > > > "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message > news:%230fRuyoAGHA.3352@TK2MSFTNGP10.phx.gbl... >> This is because 2003 double buffers the screen when deploying a non-dpi >> aware app on a hires device. >> >> Cheers >> Simon. >> >> "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message >> news:uUvhK1mAGHA.1124@TK2MSFTNGP10.phx.gbl... >>> Simon, >>> >>> I must have got away with something then in 2003. My icons look just >>> right when I deploy the 2003 app to either device. >>> >>> Graham >>> >>> >>> "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message >>> news:uQcwXviAGHA.2912@tk2msftngp13.phx.gbl... >>>> VS2003 didn't handle scaling icons. VS2005 works the same as VS2003. >>>> You still have to specify the size of the imagelist in both 2003 and >>>> 2005. >>>> >>>> It would have been nice for VS2005 to automatically change the size of >>>> the toolbar imagelist as when running in hidpi you want to use 32x32 >>>> not 16x16. >>>> >>>> Cheers >>>> Simon. >>>> >>>> "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message >>>> news:%236VeX5dAGHA.2536@TK2MSFTNGP09.phx.gbl... >>>>> Simon, >>>>> >>>>> Reasonable - but still a bloody pain to have to do all this, when >>>>> VS2003 handled it all automatically. >>>>> >>>>> Every dynamically added control requires scaling and then testing on >>>>> both devices. That's a fair amount of testing, just to convert an app >>>>> to VS2005 - eh? >>>>> >>>>> There are plenty of other "gottchas" too. Well it least it gives you a >>>>> chance to review your code and that can't be all bad. >>>>> >>>>> Graham >>>>> >>>>> >>>>> "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message >>>>> news:OoTtL9bAGHA.2080@TK2MSFTNGP10.phx.gbl... >>>>>> VS2005 does not scale icons in imagelists as used for ListView >>>>>> controls and Toolbar controls. Unfortunately you have to code for it, >>>>>> then test on VGA and QVGA devices/emulators. >>>>>> >>>>>> At first this seems like a pain but when you think about it it is >>>>>> quite resonable as you might want to use 48x48 under LargeIcon view >>>>>> in a listview not whatever the factor for the form might be. In VGA >>>>>> devices (192 dpi) this will be 32*192/96 = 64. >>>>>> >>>>>> Cheers >>>>>> Simon. >>>>>> >>>>>> >>>>>> "eastlands" <eastlands@rightfile.com> wrote in message >>>>>> news:1134639039.480355.65190@f14g2000cwb.googlegroups.com... >>>>>>>I have also found this very frustrating. I have found that in >>>>>>>addition >>>>>>> to setting AutoScaleMode=dpi you need to set AutoScaleBaseSize. >>>>>>> >>>>>>> If you create a new form/control in VS 2005 it seems to set these >>>>>>> properties by default, however I have had to add them when migrating >>>>>>> from a VS2003 project. >>>>>>> >>>>>>> Having done this most controls appear ok, however images (including >>>>>>> those on listviews and toolbars) do not get scaled. I do not know >>>>>>> any >>>>>>> way to get this done automatically so I think I will have to write >>>>>>> additional code to test the screen resolution and scale the images >>>>>>> myself. Does anyone have a better idea? >>>>>>> >>>>>>> This is frustrating as I like all the other benefits that VS2005 >>>>>>> brings. >>>>>>> >>>>>>> Stuart Eastland >>>>>>> >>>>>>> >>>>>>> Paul Moon wrote: >>>>>>> >>>>>>>> Is there any way to make it work the same way it did in VS 2003? I >>>>>>>> have >>>>>>>> an app I have been developing using a VGA device, and it always >>>>>>>> just >>>>>>>> scaled everything for me under CF 1.0. Now I have upgraded the >>>>>>>> project >>>>>>>> to CF 2.0 and I cannot get it to behave the same way! >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > >
Simon, Thanks for your reply. You originally mentioned that VS2003 double buffers the screen - that was the bit I didn't understand. Could you expand on that? I didn't know that AutoScaleMode.None gave you the default VS2003 behaviour. A bit late now as I'm nearly done converting this app, but I'll keep that in mind for some other apps that I want to convert that will never run on high resolution devices. [quoted text, click to view] > Supporting DPI awareness in your Controls: Why don't you just handle the > GDI drawing in the OnPaint event then change each hard coded coordinate to > something like: > > value * g.DpiY / 96.
Well I do practically the same. SizeF scale = new SizeF(g.DpiX / DOTSPERINCH, g.DpiY / DOTSPERINCH); But I've also found using OnParentChanged very useful as well eg if (((Form)Parent).AutoScaleDimensions.Width == 192f) { this.ScaleControl(new SizeF(2f, 2f), BoundsSpecified.Height); this.shadowPen.Width = 2f; this.framePen.Width = 2f; } I've now got both devices sitting side by side and just swap them over and retest as I go. That's not too bad once you get used to it.When I got my 4700 I never thought I was going to use the 5450 again and thought I'd sell it, but I'm glad I kept it. Active sync does a pretty neat job of handling the swapping, plus my phone. Not so sure the older versions of AS would have handled all that swapping. I am already using Michelangelo. My real problem was that I had crappy icons in the first place. I'm going to get a professional icon maker to make me some new ones. My icon drawing efforts are like "don't give up your day job" Graham [quoted text, click to view] "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message news:umyqxMvAGHA.1028@TK2MSFTNGP11.phx.gbl... > Hi Graham, > > The 2003 solution was simple but under developed and didn't support hires > devices such as the iPAQ h4700 which is 640x480 dpi or the iMate JasJar > etc..There are still lots of new devices being manufactured that only > contain QVGA screens 240x320. So with VS2005 Microsoft has added support > for both types. This makes sense as you can take advantage of the nice > higher resolution making your icons, text etc look nice and crisp. > > If you want to go back to double buffering (as per VS2003) then you can > set the AutoScaleMode of class Form to None. > > There was also a nasty little bug in VS2003 re imagelists. It wouldn't > support transparent backgrounds when adding Icons via the designer. So > this had to be done via code. So it wasn't so much hardship for me to > support hires as all I had to do was add additional code to change the > size of the imagelist depending on the resolution, then create a bigger > icon from the exiting icon stream. > > Supporting DPI awareness in your Controls: Why don't you just handle the > GDI drawing in the OnPaint event then change each hard coded coordinate to > something like: > > value * g.DpiY / 96. > > I personally always use Icons and use the Michelangelo icon editor - do a > google I'm sure you'll find the site I can't remember it now. > > Cheers > Simon. > > > "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message > news:e5UDb%23oAGHA.204@TK2MSFTNGP15.phx.gbl... >> Hi Simon, >> >> Could you explain that further? The 2003 technique sounds like a simpler >> solution, so there must have been a good reason for going away from it in >> 2005. Is it quicker the new way? >> >> I keep revising the way I'm doing this and I keep finding new ways to do >> the same thing. But I would like to make it as efficient as possible. >> >> For my custom controls I'm swinging to handling the scaling with >> ScaleControl in OnParentChanged, but then you need to check who the >> Parent is. But that doesn't get around using g.DpiX and g.DpiY in OnPaint >> if you happen to adjust anything in there. >> >> Re ImageLists I now find that I need both 16x16 and 32x32. Is there a >> tool around that easily converts gif, icons, bmp etc. from one size to >> another. I've been redrawing them, which I'm not to flash at and it's >> taking for ever. >> >> Graham >> >> >> "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message >> news:%230fRuyoAGHA.3352@TK2MSFTNGP10.phx.gbl... >>> This is because 2003 double buffers the screen when deploying a non-dpi >>> aware app on a hires device. >>> >>> Cheers >>> Simon. >>> >>> "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message >>> news:uUvhK1mAGHA.1124@TK2MSFTNGP10.phx.gbl... >>>> Simon, >>>> >>>> I must have got away with something then in 2003. My icons look just >>>> right when I deploy the 2003 app to either device. >>>> >>>> Graham >>>> >>>> >>>> "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message >>>> news:uQcwXviAGHA.2912@tk2msftngp13.phx.gbl... >>>>> VS2003 didn't handle scaling icons. VS2005 works the same as VS2003. >>>>> You still have to specify the size of the imagelist in both 2003 and >>>>> 2005. >>>>> >>>>> It would have been nice for VS2005 to automatically change the size of >>>>> the toolbar imagelist as when running in hidpi you want to use 32x32 >>>>> not 16x16. >>>>> >>>>> Cheers >>>>> Simon. >>>>> >>>>> "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message >>>>> news:%236VeX5dAGHA.2536@TK2MSFTNGP09.phx.gbl... >>>>>> Simon, >>>>>> >>>>>> Reasonable - but still a bloody pain to have to do all this, when >>>>>> VS2003 handled it all automatically. >>>>>> >>>>>> Every dynamically added control requires scaling and then testing on >>>>>> both devices. That's a fair amount of testing, just to convert an app >>>>>> to VS2005 - eh? >>>>>> >>>>>> There are plenty of other "gottchas" too. Well it least it gives you >>>>>> a chance to review your code and that can't be all bad. >>>>>> >>>>>> Graham >>>>>> >>>>>> >>>>>> "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message >>>>>> news:OoTtL9bAGHA.2080@TK2MSFTNGP10.phx.gbl... >>>>>>> VS2005 does not scale icons in imagelists as used for ListView >>>>>>> controls and Toolbar controls. Unfortunately you have to code for >>>>>>> it, then test on VGA and QVGA devices/emulators. >>>>>>> >>>>>>> At first this seems like a pain but when you think about it it is >>>>>>> quite resonable as you might want to use 48x48 under LargeIcon view >>>>>>> in a listview not whatever the factor for the form might be. In VGA >>>>>>> devices (192 dpi) this will be 32*192/96 = 64. >>>>>>> >>>>>>> Cheers >>>>>>> Simon. >>>>>>> >>>>>>> >>>>>>> "eastlands" <eastlands@rightfile.com> wrote in message >>>>>>> news:1134639039.480355.65190@f14g2000cwb.googlegroups.com... >>>>>>>>I have also found this very frustrating. I have found that in >>>>>>>>addition >>>>>>>> to setting AutoScaleMode=dpi you need to set AutoScaleBaseSize. >>>>>>>> >>>>>>>> If you create a new form/control in VS 2005 it seems to set these
Hi Graham, Its not strictly VS2003 which double buffers the screen its Win CE that does it depending on a setting in the .INF file which is used to build your applications CAB file. What it means is that your legacy apps will work on hires new devices without code change, simply by double buffering the controls, (multipling the coorindates by the form factor). But this is all dependant on the INF file. see here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/deploy_cf2_apps_cab_msi.asp - this should help. The above solution is a little messy and somewhat restrictive unless lots of effort is put into it. I certainly would not recommend it for a award winning application unless your audience is technical. I have finally got InstallShield X to work with VS2005 by means of passing it my hand madeCAB file and letting InstallSheild do the rest. Cheers Simon. [quoted text, click to view] "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message news:e98NR41AGHA.2644@TK2MSFTNGP09.phx.gbl... > Simon, > > Thanks for your reply. You originally mentioned that VS2003 double buffers > the screen - that was the bit I didn't understand. Could you expand on > that? > > I didn't know that AutoScaleMode.None gave you the default VS2003 > behaviour. A bit late now as I'm nearly done converting this app, but I'll > keep that in mind for some other apps that I want to convert that will > never run on high resolution devices. > >> Supporting DPI awareness in your Controls: Why don't you just handle the >> GDI drawing in the OnPaint event then change each hard coded coordinate >> to something like: >> >> value * g.DpiY / 96. > > Well I do practically the same. > SizeF scale = new SizeF(g.DpiX / DOTSPERINCH, g.DpiY / DOTSPERINCH); > > But I've also found using OnParentChanged very useful as well eg > if (((Form)Parent).AutoScaleDimensions.Width == 192f) > { > this.ScaleControl(new SizeF(2f, 2f), BoundsSpecified.Height); > this.shadowPen.Width = 2f; > this.framePen.Width = 2f; > } > > I've now got both devices sitting side by side and just swap them over and > retest as I go. That's not too bad once you get used to it.When I got my > 4700 I never thought I was going to use the 5450 again and thought I'd > sell it, but I'm glad I kept it. Active sync does a pretty neat job of > handling the swapping, plus my phone. Not so sure the older versions of AS > would have handled all that swapping. > > I am already using Michelangelo. My real problem was that I had crappy > icons in the first place. I'm going to get a professional icon maker to > make me some new ones. My icon drawing efforts are like "don't give up > your day job" > > Graham > > > "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message > news:umyqxMvAGHA.1028@TK2MSFTNGP11.phx.gbl... >> Hi Graham, >> >> The 2003 solution was simple but under developed and didn't support hires >> devices such as the iPAQ h4700 which is 640x480 dpi or the iMate JasJar >> etc..There are still lots of new devices being manufactured that only >> contain QVGA screens 240x320. So with VS2005 Microsoft has added support >> for both types. This makes sense as you can take advantage of the nice >> higher resolution making your icons, text etc look nice and crisp. >> >> If you want to go back to double buffering (as per VS2003) then you can >> set the AutoScaleMode of class Form to None. >> >> There was also a nasty little bug in VS2003 re imagelists. It wouldn't >> support transparent backgrounds when adding Icons via the designer. So >> this had to be done via code. So it wasn't so much hardship for me to >> support hires as all I had to do was add additional code to change the >> size of the imagelist depending on the resolution, then create a bigger >> icon from the exiting icon stream. >> >> Supporting DPI awareness in your Controls: Why don't you just handle the >> GDI drawing in the OnPaint event then change each hard coded coordinate >> to something like: >> >> value * g.DpiY / 96. >> >> I personally always use Icons and use the Michelangelo icon editor - do a >> google I'm sure you'll find the site I can't remember it now. >> >> Cheers >> Simon. >> >> >> "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message >> news:e5UDb%23oAGHA.204@TK2MSFTNGP15.phx.gbl... >>> Hi Simon, >>> >>> Could you explain that further? The 2003 technique sounds like a simpler >>> solution, so there must have been a good reason for going away from it >>> in 2005. Is it quicker the new way? >>> >>> I keep revising the way I'm doing this and I keep finding new ways to do >>> the same thing. But I would like to make it as efficient as possible. >>> >>> For my custom controls I'm swinging to handling the scaling with >>> ScaleControl in OnParentChanged, but then you need to check who the >>> Parent is. But that doesn't get around using g.DpiX and g.DpiY in >>> OnPaint if you happen to adjust anything in there. >>> >>> Re ImageLists I now find that I need both 16x16 and 32x32. Is there a >>> tool around that easily converts gif, icons, bmp etc. from one size to >>> another. I've been redrawing them, which I'm not to flash at and it's >>> taking for ever. >>> >>> Graham >>> >>> >>> "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message >>> news:%230fRuyoAGHA.3352@TK2MSFTNGP10.phx.gbl... >>>> This is because 2003 double buffers the screen when deploying a non-dpi >>>> aware app on a hires device. >>>> >>>> Cheers >>>> Simon. >>>> >>>> "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message >>>> news:uUvhK1mAGHA.1124@TK2MSFTNGP10.phx.gbl... >>>>> Simon, >>>>> >>>>> I must have got away with something then in 2003. My icons look just >>>>> right when I deploy the 2003 app to either device. >>>>> >>>>> Graham >>>>> >>>>> >>>>> "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message >>>>> news:uQcwXviAGHA.2912@tk2msftngp13.phx.gbl... >>>>>> VS2003 didn't handle scaling icons. VS2005 works the same as VS2003. >>>>>> You still have to specify the size of the imagelist in both 2003 and >>>>>> 2005. >>>>>> >>>>>> It would have been nice for VS2005 to automatically change the size >>>>>> of the toolbar imagelist as when running in hidpi you want to use >>>>>> 32x32 not 16x16. >>>>>> >>>>>> Cheers >>>>>> Simon. >>>>>> >>>>>> "Graham McKechnie" <gmknospam@bigpond.net.au> wrote in message >>>>>> news:%236VeX5dAGHA.2536@TK2MSFTNGP09.phx.gbl... >>>>>>> Simon, >>>>>>> >>>>>>> Reasonable - but still a bloody pain to have to do all this, when >>>>>>> VS2003 handled it all automatically. >>>>>>> >>>>>>> Every dynamically added control requires scaling and then testing on >>>>>>> both devices. That's a fair amount of testing, just to convert an >>>>>>> app to VS2005 - eh? >>>>>>>
Don't see what you're looking for? Try a search.
|
|
|