Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello
first sorry for my bad english,
I am on an Image Processing project and i need to have two side by side pictures.what is the siutable component for that please?
thanks.
i am using picturebox (which is inside a panel with autoscroll=true) for that project,and i have following code for zoom in and out y picture in mouse wheel event.but it has a problem :
for the first time (after run my project) when i use Ctrl + mouse wheel it works and then when i use mouse wheel without
Ctrl every thing is ok.And i can scrolll through my picture.
but when i use ctrl+wheel for the first time (which must zoom my picture) doesn'n work.It also doesn't have error.
C#
private void Form6_Load(object sender, EventArgs e)
       {
           tmpsize.Height = baseimg.Height;
           tmpsize.Width = baseimg.Width;
           pictureBox1.Height = tmpsize.Height;
           pictureBox1.Width = tmpsize.Width;
           pictureBox1.Image = baseimg;
           pictureBox1.SizeMode = PictureBoxSizeMode.Normal;

       }
 private void Form6_MouseWheel(object sender, MouseEventArgs e)
       {
           if (Control.ModifierKeys == Keys.Control)
           {
               try
               {

                   tmpsize.Height += e.Delta;
                   tmpsize.Width += e.Delta;
                   Bitmap nbpm = new Bitmap(baseimg, tmpsize);
                   pictureBox1.Height = tmpsize.Height;
                   pictureBox1.Width = tmpsize.Width;
                   pictureBox1.Image = nbpm;
                                  }
               catch
               {
               }
           }
           else
           {
               panel1.Focus();
           }
       }

thenks.
Posted
Updated 16-Apr-13 22:51pm
v3
Comments
johannesnestler 17-Apr-13 4:23am    
You did't say which GUI technology you are using. Forms? WPF? ASP? Metro? Silverlight? Can all be done in "C#". So hard to tell what suits your need. But in general I'd say: two PictureBoxe-like controls?
MaazSh 17-Apr-13 4:46am    
I'm using WinForm s.
Actually i want to load two images in my project and show them side by side.
And i need them to be zoomed in and out and manipulate them with Image Processing filters.And i want them to stay divide when my form maximize and minimize.
johannesnestler 17-Apr-13 5:37am    
You could do it with two PictureBox controls, but I wouldn't recommend that. For your case I'd use a Paint-Event (maybe create a dedicated UserControl for this) and use graphics.DrawImage to zoom and redraw the Images. = more control, more performance, more flexibility...

SQL
I'm using WinForm s.
Actually i want to load two images in my project and show them side by side.
And i need them to be zoomed in and out and manipulate them with Image Processing filters.And i want them to stay divide when my form maximize and minimize.
 
Share this answer
 
Depends on a lot of factors: if you have them as separate Images, then you could use a pair of PictureBoxes. Or you might want to draw them yourself in the Form.Paint event. Which I would use would depend on what else I was doing with them - we can't give you a "this is best" answer, becasue there really isn't one for all situations.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900