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. Web Development
  3. ASP.NET
  4. how to merge images dynamically(asp.net'c#)

how to merge images dynamically(asp.net'c#)

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasetutorialquestion
5 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.
  • S Offline
    S Offline
    shyamkrishnan
    wrote on last edited by
    #1

    i am a fresher in asp.net.in my project, i hav a doubt that..how to merge two .gif images in a webform dynamically? my project is a sattellite tracking system in which there are two basic images one is a ""logo""and the other is a ""background""map. when ever i am inserting longitude and latitude values in the database, the logo should come on the map in the exact position.i should have to put many more than one logos at the same map.that is by clicking "update" button each time the map should be updated. put some ideas ..i tried it but some image format errors are coming.pixel format and this .gif image format..

    G 1 Reply Last reply
    0
    • S shyamkrishnan

      i am a fresher in asp.net.in my project, i hav a doubt that..how to merge two .gif images in a webform dynamically? my project is a sattellite tracking system in which there are two basic images one is a ""logo""and the other is a ""background""map. when ever i am inserting longitude and latitude values in the database, the logo should come on the map in the exact position.i should have to put many more than one logos at the same map.that is by clicking "update" button each time the map should be updated. put some ideas ..i tried it but some image format errors are coming.pixel format and this .gif image format..

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Do you have to merge the images? Can't you just place one image on top of the other?

      --- b { font-weight: normal; }

      S 1 Reply Last reply
      0
      • G Guffa

        Do you have to merge the images? Can't you just place one image on top of the other?

        --- b { font-weight: normal; }

        S Offline
        S Offline
        shyamkrishnan
        wrote on last edited by
        #3

        no..its not like that...i have to merge a perticular icon in a map,suppose in indias map when the administrator is inputting the corresponding geographical measures.(longitude and latitude). first to check whether the given measures are covering which area..after checking that it identifies that area is India.then it finds the inner exact position and merge the icon image there..(For this i am using gif images of background map(image1) and icon(image2).i want to merge image2 on image 1 when ever inserting the measurement in the database...) TRY IT>>>ITS NOT SIMPLE I THINK>>>give me idea about grids also..that can help..

        V G 2 Replies Last reply
        0
        • S shyamkrishnan

          no..its not like that...i have to merge a perticular icon in a map,suppose in indias map when the administrator is inputting the corresponding geographical measures.(longitude and latitude). first to check whether the given measures are covering which area..after checking that it identifies that area is India.then it finds the inner exact position and merge the icon image there..(For this i am using gif images of background map(image1) and icon(image2).i want to merge image2 on image 1 when ever inserting the measurement in the database...) TRY IT>>>ITS NOT SIMPLE I THINK>>>give me idea about grids also..that can help..

          V Offline
          V Offline
          Vicky Roberts
          wrote on last edited by
          #4

          Check the following code In this example Image2 will be added to the Image1, you need to just change the names from Images1.gif and Image2.gif to your image name. Let me know if you have any issues. //Code Starts Here // This is the Original Image that is Image1 System.Drawing.Image bgimage = System.Drawing.Image.FromFile(Server.MapPath("Image1.gif")); Bitmap bmp = new Bitmap(1, 1); Graphics graphic = System.Drawing.Graphics.FromImage(bmp); // measure the image int height = bgimage.Height; int width = bgimage.Width; // recreate our bmp and graphic objects with the new measurements bmp = new Bitmap(width, height); graphic = System.Drawing.Graphics.FromImage(bmp); graphic.DrawImage(bgimage, 0, 0, width, height); graphic.TextRenderingHint = TextRenderingHint.SystemDefault; System.Drawing.Image bgimageNew = System.Drawing.Image.FromFile(Server.MapPath("Image2.jpg")); //You can set x position, y position, width and height of the second image. graphic.DrawImage(bgimageNew,5,5,50,15); // Set the content type and return the image Response.ContentType = "image/JPEG"; bmp.Save(Response.OutputStream, ImageFormat.Jpeg); // dispose of our objects bgimage.Dispose(); graphic.Dispose(); bmp.Dispose(); //Code Ends Here Vicky "Walking on water and developing Software on a specification is easy, if both are frozen..."

          1 Reply Last reply
          0
          • S shyamkrishnan

            no..its not like that...i have to merge a perticular icon in a map,suppose in indias map when the administrator is inputting the corresponding geographical measures.(longitude and latitude). first to check whether the given measures are covering which area..after checking that it identifies that area is India.then it finds the inner exact position and merge the icon image there..(For this i am using gif images of background map(image1) and icon(image2).i want to merge image2 on image 1 when ever inserting the measurement in the database...) TRY IT>>>ITS NOT SIMPLE I THINK>>>give me idea about grids also..that can help..

            G Offline
            G Offline
            Guffa
            wrote on last edited by
            #5

            shyamkrishnan wrote:

            no..its not like that...

            What is it not like? I see no reason why you have to merge the images. It's not that hard to do, but why would you if you don't have to?

            --- b { font-weight: normal; }

            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