-
Sep 12th, 2019, 10:21 AM
#81
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
-
Sep 1st, 2021, 02:27 PM
#82
New Member
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
-
Sep 1st, 2021, 02:35 PM
#83
Re: ZoomPictureBox: picture control with mouse-centred zooming
Originally Posted by davidgarnett
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
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Sep 1st, 2021, 02:51 PM
#84
New Member
Re: ZoomPictureBox: picture control with mouse-centred zooming
Originally Posted by .paul.
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.
-
Sep 1st, 2021, 03:29 PM
#85
Re: ZoomPictureBox: picture control with mouse-centred zooming
Originally Posted by davidgarnett
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....
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Sep 2nd, 2021, 03:38 PM
#86
New Member
Re: ZoomPictureBox: picture control with mouse-centred zooming
Originally Posted by .paul.
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?
-
Sep 3rd, 2021, 06:14 AM
#87
Re: ZoomPictureBox: picture control with mouse-centred zooming
Originally Posted by davidgarnett
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
-
Sep 3rd, 2021, 07:18 AM
#88
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)
-
Sep 5th, 2021, 05:15 AM
#89
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
-
Jan 5th, 2022, 03:32 PM
#90
New Member
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.
-
Jan 11th, 2022, 07:00 PM
#91
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|