Panoramic image in C # Windows Forms

2

I'm doing a new project using C # windows forms, and needed to open a panoramic image and rotate it just horizontally. I looked for some examples on the internet, but found none that is clear. Someone has some example that can help me.

    
asked by anonymous 25.11.2014 / 19:35

1 answer

0

Try to insert a PictureBox into a Panel whose AutoScroll property is True , and then modify the Height property of the image within the PictureBox to be the same as the Panel .

Consider% with% of% of%,% with% of% with%

//crie um handler no "p" para o evento "Load"
void p_Load(Object sender, EventArgs args) {
   // isso irá ativar a ScrollBar automática no painel
   p.AutoScroll = true;

   // adiciona o controle "pb" para dentro do painel
   p.Controls.Add(pb);

   // modifica a localização e dimensões da imagem
   pb.Location = new Point(0, 0);
   // define a imagem para o pb
   pb.Image = img;
   // auto ajusta a imagem
   pb.SizeMode = PictureBoxSizeMode.StretchImage;
   // chama a variável "SystemInformation.HorizontalScrollBarWidth"
   // que é o tamanho horizontal da scroll bar
   pb.Size = new Point(img.Width, img.Height -  SystemInformation.HorizontalScrollBarWidth - 1);
   // atualiza a PictureBox
   pb.Refresh();
}

If you want to refresh the image, just call the pb method again.

    
25.11.2016 / 02:14