Results 1 to 13 of 13

Thread: Zoom IN/OUT

  1. #1

    Thread Starter
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Zoom IN/OUT

    How can i have s fine zoom in/out of a raster image? as i found that the StretchBlt will return a poor output.

  2. #2
    Lively Member Liquid Pennies's Avatar
    Join Date
    Jun 2002
    Location
    Charlotte, NC
    Posts
    124
    stretchblt is the only easy way i can think of.

    if you want you could do it like this. say you zoom in 600%. you could make another picture 3 times as big. then, for every 1 pixel, you have in the original, paint 9 pixels (3*3).

    then when your zooming out, you need to take every third pixel in the stretched image and write it to another pixture box.

    if you need me to clarify, just tell me

  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
    look at www.ur.co.nz you can download code from a tutorial there that does the exact thing you are asking for
    Sanity is a full time job

    Puh das war harter Stoff!

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Not a gamer but

    VB Code:
    1. picdest.PaintPicture picSource.Picture, 0, 0, _
    2.     picSource.ScaleWidth * ZoomFactor, picSource.ScaleHeight * ZoomFactor

    Is this at all what you are looking for?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  5. #5
    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
    haah true that works
    Gamers always forget about this since you stop using those functions as soon as you understand bit blt...
    Sanity is a full time job

    Puh das war harter Stoff!

  6. #6
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    So this solves the problem?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  7. #7

    Thread Starter
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Thx you guy

    Oops... I'm coding in eVC for WindowCe platforms. So i can't use any VB code. In eVC, I only manage to find out the SetViewportOrgEx and SetViewportExtEx but not the others two SetWindowExtEx and SetWindowOrgEx. That why i lost the ScaleWidth and ScaleHeight capability in eVC.

    As for the link, I will check ut out later.

    regards,

  8. #8
    Hyperactive Member
    Join Date
    Aug 2004
    Posts
    281

    Re: Well

    Originally posted by James Stanich
    Not a gamer but

    VB Code:
    1. picdest.PaintPicture picSource.Picture, 0, 0, _
    2.     picSource.ScaleWidth * ZoomFactor, picSource.ScaleHeight * ZoomFactor

    Is this at all what you are looking for?


    picdest, picsource, and zoomfactor. Can I use these in VB.NET and what imports should I use?
    I'm not very familiar with stretch blt, so if that is the way can you give me some detail~

    edit: How would I go about having a click event zoom? (left click zoom in, right click zoom out)

  9. #9
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    Re: Re: Well

    Posted by DavidProgrammer
    picdest, picsource, and zoomfactor. Can I use these in VB.NET and what imports should I use?
    I'm not very familiar with stretch blt, so if that is the way can you give me some detail~

    edit: How would I go about having a click event zoom? (left click zoom in, right click zoom out)
    picdest & picsource are just pictureBoxes . Zoomfactor looks like its just a variable .


    BTW you do know this thread is 2years old?
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  10. #10
    Hyperactive Member
    Join Date
    Aug 2004
    Posts
    281

    Red face

    lol. do now~

    You think you can help me though? I need a click effect zoom on a picture...like a map

  11. #11
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Yea I'm not totally sure what you mean your after though?
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  12. #12

  13. #13
    Hyperactive Member
    Join Date
    Aug 2004
    Posts
    281
    It may be solved with that, but I want to learn code. I got scrolling to work with me. Now I need the zoom capability. I don't think BitBLT works really good with VB.NET or it takes more complicated coding than what I know. Is there a way to use the System.Drawing reference to zoom?

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