Page 3 of 3 FirstFirst 123
Results 81 to 91 of 91

Thread: ZoomPictureBox: picture control with mouse-centred zooming

  1. #81

    Thread Starter
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,183

    Re: ZoomPictureBox: picture control with mouse-centred zooming

    Hi Paul, welcome to VBForums.

    The ZoomPictureBox allows you to set the Image to Nothing and to call its Invalidate method in much the same way as a PictureBox. In both cases, the image source file remains locked. The safest way to avoid this is to read the image as a Stream instead of opening it with Image.FromFile(filename) or New Bitmap(filename).
    Code:
        Using stream As IO.Stream = IO.File.OpenRead(filename)
             ZoomPictureBoxName.Image = Image.FromStream(stream)
          End Using
    The source file is closed at the end of the Using block, so you are free to delete it independently of the image.

    BB

  2. #82
    New Member
    Join Date
    Aug 2021
    Posts
    3

    Re: ZoomPictureBox: picture control with mouse-centred zooming

    I would like to contact the author of this library. I'm using the library in an application and need some information that I hope he can provide

  3. #83
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    24,507

    Re: ZoomPictureBox: picture control with mouse-centred zooming

    Quote Originally Posted by davidgarnett View Post
    I would like to contact the author of this library. I'm using the library in an application and need some information that I hope he can provide
    BoopsBoops is the author of this software. This thread is the place to ask your questions

  4. #84
    New Member
    Join Date
    Aug 2021
    Posts
    3

    Re: ZoomPictureBox: picture control with mouse-centred zooming

    Quote Originally Posted by .paul. View Post
    BoopsBoops is the author of this software. This thread is the place to ask your questions
    Paul,

    Thank you for your reply ... I'm new to VBForums. I thought I replied with my question to this thread.

    If I didn't, please let me know how to reply.

  5. #85
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    24,507

    Re: ZoomPictureBox: picture control with mouse-centred zooming

    Quote Originally Posted by davidgarnett View Post
    Paul,

    Thank you for your reply ... I'm new to VBForums. I thought I replied with my question to this thread.

    If I didn't, please let me know how to reply.
    Yeah you're posting in the right place, but you haven't given any details with your comment. Boops Boops will need to know what it is you need to know....

  6. #86
    New Member
    Join Date
    Aug 2021
    Posts
    3

    Re: ZoomPictureBox: picture control with mouse-centred zooming

    Quote Originally Posted by .paul. View Post
    Yeah you're posting in the right place, but you haven't given any details with your comment. Boops Boops will need to know what it is you need to know....
    There is no license information for ZPLib that I can find. Can the developer associate a license with the library? ... perhaps MIT?

  7. #87

    Thread Starter
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,183

    Re: ZoomPictureBox: picture control with mouse-centred zooming

    Quote Originally Posted by davidgarnett View Post
    There is no license information for ZPLib that I can find. Can the developer associate a license with the library? ... perhaps MIT?
    That question applies to any code library, not just ZPLib. And it's not something I know much about. Please address your question to another forum such as Visual Basic .Net or C#.

    BB

  8. #88
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    742

    Re: ZoomPictureBox: picture control with mouse-centred zooming

    Boops Boops, I think Davidgarnett want to know what is the license associated with your library/class to know if he can use it freely or not in his own applications.
    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so they did it” (Mark Twain)

  9. #89

    Thread Starter
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,183

    Re: ZoomPictureBox: picture control with mouse-centred zooming

    As far as I know all code posted in the CodeBank is unlicensed, so you are free use it however you like. if you include the code in a licensed project, it would be polite to add a comment referring to this thread or to my authorship. BB

  10. #90
    New Member
    Join Date
    Jan 2022
    Posts
    1

    Re: ZoomPictureBox: picture control with mouse-centred zooming

    Hello, thank you for providing such great code.
    Unfortunately, the main post directs to post #75 to get the February 2019 version, but post #75 redirects back to the main post, which are two zip files, both from 2012, none of them with the newly added "DragMargin" property. There may have been a mix-up when editing posts. Would it be possible for OP to upload the new version? Thanks a lot.

  11. #91

    Thread Starter
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,183

    Re: ZoomPictureBox: picture control with mouse-centred zooming

    Hi John, you are right. When I posted the last link nearly 3 years ago, I intended move it to post #1 where anyone could find it. But I discovered some errors and never got around to fixing them. Life got in the way... And then a month ago - even worse - I decided to clear out what seemed to be obsolete links in the thread. I forgot that the link in post #1 wasn't updated. What a mess: it took me quite a while to sort it out but now at least I have a new version with the following changes:

    1. SafeMargin works OK.
    2. The two separate files for the ZoomPictureBox class (Main and Properties) are now merged into one. Separating them seemed like a good idea at first but no longer.
    3. The panning and zooming for very large images works smoothly, but they can be very slow to load. There must be a better way. And very large images seem prone to throw OutOfMemory exceptions in Visual Studio 2022. That will take some work
    4. There was a problem with transparent backgrounds. I don't know if anyone noticed but it's fixed now.

    Here's an interim version of the ZoomPictureBox Class you may care try out:
    ZoomPictureBox_Jan2022.vb
    Questions, suggestions and criticism are welcome.

    BB

Page 3 of 3 FirstFirst 123

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