Implement scale view
-
Hi. I want my view support zoom in/out feature, such as Word and Visio, user can set view scale to 400%, 200%, 100%, 50%, etc. Currently I implement this feature by GDI mapping( MM_ANISOTROPIC ), my view contain a workarea and some graphs( bitmap ), I change GDI mapping when user set view zoom. Now the problem is GDI mapping is not good when draw a bitmap, even worse then StretchBlt. what are you think about it? or have better ways to do it.
-
Hi. I want my view support zoom in/out feature, such as Word and Visio, user can set view scale to 400%, 200%, 100%, 50%, etc. Currently I implement this feature by GDI mapping( MM_ANISOTROPIC ), my view contain a workarea and some graphs( bitmap ), I change GDI mapping when user set view zoom. Now the problem is GDI mapping is not good when draw a bitmap, even worse then StretchBlt. what are you think about it? or have better ways to do it.
well ...scaling must be done with a "scaling factor" meaning... double scale=1; CreatFont.withsize(12*scale) //... that will equal to 100% scaling... scale=2; CreatFont.withsize(12*scale) //... that will equal to 200% scaling... scale=3; CreatFont.withsize(12*scale) //... that will equal to 300% scaling... everything must be done the same way ... (by a scaling factor) bitmap scaling must be done with a generic algorithm (StrechBlt is only good in winXP) or use GDI+