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. reduce of picture to fit panel size

reduce of picture to fit panel size

Scheduled Pinned Locked Moved C#
csharphelpquestion
3 Posts 3 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.
  • E Offline
    E Offline
    Eddie1987
    wrote on last edited by
    #1

    I'm making a project in c# that looks like Paint.Net i hace a panel in the middel of the form (form size=900,500 panel size=800,400) when i load a bigger picture like 801,401 and above i don't want to increase the panel size instead i want to reduce the pic's pixel so that will fit into the original panel size. can someone help me with that ? :doh:

    OriginalGriffO 1 Reply Last reply
    0
    • E Eddie1987

      I'm making a project in c# that looks like Paint.Net i hace a panel in the middel of the form (form size=900,500 panel size=800,400) when i load a bigger picture like 801,401 and above i don't want to increase the panel size instead i want to reduce the pic's pixel so that will fit into the original panel size. can someone help me with that ? :doh:

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      It's difficult to give you a simple answer to that, as there are a lot of factors that are involved. How are you showing the picture in the panel? Hopefully, you are handling the Paint event, and drawing it yourself. If not, why not? How do you want to show the picture? Zoomed? Stretched? Proportional to the panel size, or the original image size? (i.e. if the panel is 800 x 400 and the picture is 1000x1000, what do you show - all the pixels? All the pixels horizontally, and some of the vertical ones? Or something else?)

      Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      M 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        It's difficult to give you a simple answer to that, as there are a lot of factors that are involved. How are you showing the picture in the panel? Hopefully, you are handling the Paint event, and drawing it yourself. If not, why not? How do you want to show the picture? Zoomed? Stretched? Proportional to the panel size, or the original image size? (i.e. if the panel is 800 x 400 and the picture is 1000x1000, what do you show - all the pixels? All the pixels horizontally, and some of the vertical ones? Or something else?)

        Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

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

        Also consider using a picturebox inside the panel. This has properties for scaling/zooming etc.

        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