CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Zooming

  1. #1
    Join Date
    Apr 2001
    Posts
    1

    Zooming

    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.



  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Zooming

    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.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: Zooming

    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.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured