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. Stretching and Transforming Pictures

Stretching and Transforming Pictures

Scheduled Pinned Locked Moved C#
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.
  • R Offline
    R Offline
    Reanalyse
    wrote on last edited by
    #1

    Can on use "transforming" and "stretching" to copy a part of one picture to another picture object. Thanks

    W 1 Reply Last reply
    0
    • R Reanalyse

      Can on use "transforming" and "stretching" to copy a part of one picture to another picture object. Thanks

      W Offline
      W Offline
      Werdna
      wrote on last edited by
      #2

      You can use Graphics.DrawImage to draw part of one image onto another. Just use: Graphics g1 = Graphics.FromImage(destinationImage); g1.DrawImage(sourceImage, you can specify source coordinates and destinartion coordiates here just lookup the many overload for DrawImage); g1.Dispose();

      R 1 Reply Last reply
      0
      • W Werdna

        You can use Graphics.DrawImage to draw part of one image onto another. Just use: Graphics g1 = Graphics.FromImage(destinationImage); g1.DrawImage(sourceImage, you can specify source coordinates and destinartion coordiates here just lookup the many overload for DrawImage); g1.Dispose();

        R Offline
        R Offline
        Reanalyse
        wrote on last edited by
        #3

        Thanks for that When I try that code i.e. _____________________________________________________________________________ Graphics g1 = Graphics.FromImage(viewer1.Image); g1.DrawImage(dxfdefaultBox.Image, new Rectangle(1,1,400,300),new Rectangle(1,1,1000,1000),GraphicsUnit.Pixel); g1.Dispose(); _____________________________________________________________________________ I get a "An unhandled exception of type 'System.ArgumentNullException' occurred in system.drawing.dll". viewer1.Image is stated as viewer1 does exist as a pictureBox on the form, and I can write directly to it through a device context -do you have any idea as to why it would appear as a null item in this use ? Thanks

        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