Results 1 to 9 of 9

Thread: a question zoom out a picture

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    4

    a question zoom out a picture

    I try to zoom out a picture in a picturebox using stretchblt API or paintpicture method , it 's normal working when the picture's width/height under about 6000 pixels, but if over that size, the picturebox will be filled in backcolour, any image date lost.

    for example: i try to zoom out a picture (size =800x600) to 800%,
    that error is occured and speed of zoom is very slow.
    A famous software named ACDSEE is so good do that job, and speed of zoom is big faster than my program.

    does anybody know how to solve that problem? pls give me a hand.

  2. #2
    Techi
    Guest

    ill get back to u

    i have the code someware, just give me a few days (remind me if i forget)

  3. #3
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    you could create more than one picturebox and split the original picture over them with your strectchblt
    Sanity is a full time job

    Puh das war harter Stoff!

  4. #4
    Techi
    Guest

    stretching

    yes that was what i was going to suggest but perhaps the image can be changed using:

    Private Sub hsbWidth_Change()
    imgPic.Width = hsbWidth.Value
    End Sub

    Private Sub hsbHeight_Change()
    imgPic.Height = hsbHeight.Value
    End Sub

    Or if you want you could have a value set at the start of the project and use buttons:

    Private Sub ZoomAdd_Click()
    Zoom = Zoom + 10
    imgPic.Width = imgPic.Width + Zoom
    imgPic.height = imgPic.Height + Zoom
    End Sub

    Private Sub ZoomOut_Click()
    Zoom = Zoom - 10
    imgPic.Width = imgPic.Width - Zoom
    imgPic.height = imgPic.Height - Zoom
    End Sub

    Havent tested this so be warned

  5. #5
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Hum, why do you wanna make such a big image even bigger?
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  6. #6
    Techi
    Guest

    bigger

    if yyou zoom out dosnt the pic get smaller!

  7. #7
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Hey Techi
    I think your code is a little wrong.

    If you add like 5 times and than you substract one time you wouldn't get the same result as if you would have pressed add 4 times, but the result of pressing 4 times substract.
    You would need to set the zoom variable to 0 before adding or substracting those 10.
    Sanity is a full time job

    Puh das war harter Stoff!

  8. #8
    Techi
    Guest

    oh year!

    I have just started looking in to the simplest pure vb way into solving this problem without trying to ues api, DX or Active X controls.

  9. #9
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Why don't you wanna use that kind of stuff? It'll work on everyone's computer and the web is full of wrapper modules or DLLs to make its use even easier
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

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