Click to See Complete Forum and Search --> : Zooming


D_Ravindra
April 11th, 2001, 06:44 AM
I am creating a page preview sort of application.
I am using picture box in that.I want to provide zooming in and zooming out facility for it.Please send me your suggestions about how can I do it? I want text and lines on the document to be zoomed in and out.
Also please suggest if I can use some other object to have this effect.

Cimperiali
April 11th, 2001, 07:11 AM
If you can use imagebox do display picture, it will be easy to zoom in and out changing the stretch porperty to true and then enlarging and restricting size of imagebox.


Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.

shree
April 11th, 2001, 07:54 AM
If it is just text and lines in your document, you are well off redrawing everything in the new scale. This will retain the quality of your output, but at the cost of speed.

If you use raster shrinking and expansion(using StretchBlt()), the application response will be fast, but your image will lose quality. There are methods that enable you to enhance your output(for example, use SetStretchBltMode()with the STRETCH_ANDSCANS parameter to retain black pixels at the cost of white.)

Still another method exists that retains the speed of raster operations and with acceptable quality. That is antialiasing. If you have noted in Adobe Acrobat, the fonts seem so smooth. But if you zoom in (for example, take a sanpshot, paste it in MSPaint and view in Large size), you will see certain shades of gray around the character. This is the technique of antialiasing.

Are you conversant with C++? If so, there is a code that does this in
http://www.codeguru.com/bitmap/bitmapShrinking.shtml
You can take the code, make a DLL and call it from VB. This gives you the shrinked bitmap with antialiasing.