• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 370
  • Last Modified:

View large images in a PicBox control - VB.NET 2005

VB .NET 2005 Express

I have a picturebox control that will display very large images. What I would ideally like to be able to do is change the mousecursor property for that control to a hand, and allow the user to view the whole image by dragging it around (like you can drag Adobe PDF documents around).

How would I be able to do this?
Thanks in advance.
0
Ryan_R
Asked:
Ryan_R
  • 7
  • 3
1 Solution
 
ericwong27Commented:
Alternately you can put the picture box inside the Panel control.

Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize
Me.Panel1.AutoScroll = True

The picture can be scroll up/down/left/right
0
 
Ryan_RAuthor Commented:
Thanks - that does work, and I may use that if I can't get the ideal solution - so I'll leave the question open to see if anyone else knows.
0
 
Ryan_RAuthor Commented:
I think I may have found the solution here:
http://www.codeproject.com/useritems/PanExample.asp

I'll post back after I've tried out the code.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Ryan_RAuthor Commented:
If you could explain to me how to perform the following in more detail - I'll award you the points:
--------------------------------------------------------------------------------------------------------------------------

Hiding the scrollbars:
  If you would like to use the above code, but do not wish to see the scrollbars for the Panel, here is an idea. First, create a new control that inherits from Panel. Second add the following snippet of code:

     Protected Overrides Sub DefWndProc(ByRef m As Message)      If m.Msg <> 131 Then           MyBase.DefWndProc(m)      End If     End Sub
Use this new control instead of the native panel control. This will give you a control without visible scrollbars. They are still there as far as the controll is concerned; they just weren't painted to the screen. Therefore, you will still be able to use the panels autoscroll property and AutoScrollPosition method.

0
 
Ryan_RAuthor Commented:
I used the compiled DLL file in the following archive to achieve this - thanks for having a shot:
http://www.codeproject.com/useritems/PanZoomExample/Queens_ImageControl_VS2005.zip

Ryan
0
 
Vee_ModCommented:
Closed, 400 points refunded.
Vee_Mod
Community Support Moderator
0
 
Ryan_RAuthor Commented:
What's with the above comment Vee - the details don't appear in the Sky-blue bar (which is a bad colour if you're trying to read the white text). I'll let you forward it as a bug if you want.

Ryan
0
 
Ryan_RAuthor Commented:
Now I see what's going on - takes a bit of getting used to  :)
0
 
Vee_ModCommented:
Hi Ryan - this is all part of a totally jacked-up new process that some moron at EE thought up (on drugs - obviously).

By the way - an "undocumented feature" of this new glitch is that your 'Answered Questions" total was just decremented by one because you posted in a 'closed' question.

Isn't that just luverly?

V
0
 
Ryan_RAuthor Commented:
No - don't tell me some mod is just jealous that they don't have a high total of Answered Questions.

I also think that the emails we get from these types of comments is stupid - the standard emails would have sufficed. And it appears that the question asked in CS was automatically locked (or you locked it) which means this discussion has to take place in a more open environment (more people will see it).

I'm not going to raise a huge concern in the bugs area as I've changed my EE status from helping out everyday to just trying to get 3000 points per month. And I still do a little cleanup work now and then to help Annie out.
0
 
Vee_ModCommented:
Nay, nay kind sir.
Mods don't have anywhere near those kinds of privs.
There is a group of actual paid employees (hard to believe) who actually run the physical side of the site.
One of their favorite tricks is to implement a new procedure just before 5pm on a Friday night and then go home for the weekend.
They've managed to crash the site completely a couple of times this year, but usually they just jack up all the procedures that the volunteers are used to using.

Fun group of folks.

As far as what happened in CS, I have no clue.
Those questions are supposed to stay open for 7 days to allow comment by the Asker or the concerned Experts.

Sound off through the 'Feedback' link if you like, but I doubt that it will do any good.
V
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 7
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now