Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Zoom problem with a picture within picturebox.?

Zoom problem with a picture within picturebox.?

Scheduled Pinned Locked Moved C#
questionhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maifs
    wrote on last edited by
    #1

    i am trying this...but it doesn't affect on picture. public void OnZoom25(bool zoomEnable) { zoom25Enable = zoomEnable; if (zoom25Enable) { Zoom = 5.25; this.AutoScrollMinSize = new Size((int)(m.Width * Zoom), (int)(m.Height * Zoom)); pbx.Image = m; this.Invalidate(); } } i want to zoom up the picture but picture is in picture box(pbx).. the form's size increses but picture stay there how can i zoom up it with picture ox?

    hghghgh

    N 1 Reply Last reply
    0
    • M maifs

      i am trying this...but it doesn't affect on picture. public void OnZoom25(bool zoomEnable) { zoom25Enable = zoomEnable; if (zoom25Enable) { Zoom = 5.25; this.AutoScrollMinSize = new Size((int)(m.Width * Zoom), (int)(m.Height * Zoom)); pbx.Image = m; this.Invalidate(); } } i want to zoom up the picture but picture is in picture box(pbx).. the form's size increses but picture stay there how can i zoom up it with picture ox?

      hghghgh

      N Offline
      N Offline
      nelsonpaixao
      wrote on last edited by
      #2

      tell me if you find out how. :^) try this, i place the picturebox inside a panel(220size) and i allow scroll. maybe you only need this.

      ...
      Image img = Image.FromFile(open_file_dialog.FileName);
      if (img.Height > 220 || img.Width > 220)
      {
      mypicturebox.SizeMode = PictureBoxSizeMode.AutoSize;
      mypicturebox.Dock = DockStyle.None;
      mypicturebox.Location = new System.Drawing.Point(0, 0);
      }
      else
      {
      mypicturebox.SizeMode = PictureBoxSizeMode.CenterImage;
      mypicturebox.Dock = DockStyle.Fill;
      }

      good luck X|

      nelsonpaixao@yahoo.com.br trying to help & get help

      M 1 Reply Last reply
      0
      • N nelsonpaixao

        tell me if you find out how. :^) try this, i place the picturebox inside a panel(220size) and i allow scroll. maybe you only need this.

        ...
        Image img = Image.FromFile(open_file_dialog.FileName);
        if (img.Height > 220 || img.Width > 220)
        {
        mypicturebox.SizeMode = PictureBoxSizeMode.AutoSize;
        mypicturebox.Dock = DockStyle.None;
        mypicturebox.Location = new System.Drawing.Point(0, 0);
        }
        else
        {
        mypicturebox.SizeMode = PictureBoxSizeMode.CenterImage;
        mypicturebox.Dock = DockStyle.Fill;
        }

        good luck X|

        nelsonpaixao@yahoo.com.br trying to help & get help

        M Offline
        M Offline
        maifs
        wrote on last edited by
        #3

        thx

        Maifs

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups