Results 1 to 4 of 4

Thread: Zoom Problem Again !

  1. #1

    Thread Starter
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535

    Unhappy

    I am using the following code given by one of the VB WORLD.COM member to zoom a picture.

    Dim speed As Integer
    speed = 5
    With ActiveForm.Picture2
    .Picture = .Image
    .PaintPicture ActiveForm.Picture2, 0, 0, .ScaleWidth, .ScaleHeight, .ScaleWidth / speed, .ScaleHeight / speed, .ScaleWidth - .ScaleWidth / speed * 2, .ScaleHeight - .ScaleHeight / speed * 2
    End With

    The problem is that the picture is distorted when I use this method. Can anyone suggest me anothe way to Zoom out and Zoom in a picture?


    Thanks.
    Kinjal


  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Wink

    I posted that two times, and no-one did reply. What do you mean with distorted? If you have large difference between height & width of the picture, you should consider modifying my code by setting a general zooming var or modify the scale
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535

    Unhappy

    Sorry for asking the same question but since VB is new to me I only know the basics of it and nothing in deep. Also i am not at all familiar with API so I couldn't understand your code,and didn't modify it.

    However thanks for your reply.

    Can you please tell me whwther I can use the same code for demagnifying purpose?


    Thanks a lot.

    Kinjal.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Talking

    There's nothing API about my code. Just put a negative value instead of a positive value to speed. Also, I suggest you should play around a bit with paintpicture, so that you know what you're doing.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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