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 OriginalGriff 278
1 Maciej Los 205
2 DamithSL 193
3 Nguyen.H.H.Dang 190
4 arvind mepani 187


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