Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET PIC
Hi comunity, i've been started a image viewer project, the application must show a spesific photo linked to a part number and show information about the Part number.
 
DB: MS Access 2007
Source Code: VB.NET 2005
 
The picture is set in a PictureBox, the picture Box is set into a Split Panel (Panel2), Zoom Button, Reset Button, Search Button,etc works.
 
Zoom code:
Me.PictureBox1.Width += 200%
        Me.PictureBox1.Height += 150%
 

with this code i cant move up and down througth the image
Private Sub SplitContainer1_MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles SplitContainer1.MouseWheel
    Dim myView As Point = Me.SplitContainer1.Panel2.AutoScrollPosition
    myView.X = (myView.X + 50)
    myView.Y = (myView.Y + 50)
    Me.SplitContainer1.Panel2.AutoScrollPosition = myView
 

But now i want move througt image with left click, like when the mouse looks like Pan hand
 
http://www.kareprints.com/wp-content/uploads/2010/10/pan-detail.png
Posted 20-Nov-12 9:35am
iKsn213
Edited 20-Nov-12 9:57am
v2
Comments
Sergey Alexandrovich Kryukov at 20-Nov-12 15:49pm
   
Why using PictureBox? This is the problem. For any advanced features, you need your own control, not PictureBox, which does not help you at all, only adds hassles.
--SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Please see my comment. You don't need to use PictureBox. Instead of helping you, it only eats up some resources, performance and development time. It is really designed only for simplest cases. Even though you can achieve results with this control, you loose, not gain. I'll tell your what to do instead. Please see my past answers:
How do I clear a panel from old drawing[^],
draw a rectangle in C#[^],
Append a picture within picturebox[^].
 
And also:
Drawing Lines between mdi child forms[^],
capture the drawing on a panel[^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^].
 
—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 430
1 _Amy 235
2 Andreas Gieriet 180
3 Nirav Prabtani 163
4 Peter Leow 160
0 OriginalGriff 7,540
1 Sergey Alexandrovich Kryukov 6,597
2 Maciej Los 3,849
3 Peter Leow 3,653
4 CHill60 2,712


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100