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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. image uploading

image uploading

Scheduled Pinned Locked Moved C#
tutorialquestion
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.
  • T Offline
    T Offline
    TAREQ F ABUZUHRI
    wrote on last edited by
    #1

    in my site i have form to upload image this image may be very big or very small but after user upload this image i want make some imagte prossessing as ( 1- i want to make two image from the original image 2- the first image have (50*50) cordinate 3- the secode image have (200*200) as max hight and max wiedth 4-i want for each image to take new name ) u can see example in this site http://www.blocket.se/vi/7874861.htm?ca=10\_s u can see tow image one small and one big how can do as this in my site Palestine

    J B 2 Replies Last reply
    0
    • T TAREQ F ABUZUHRI

      in my site i have form to upload image this image may be very big or very small but after user upload this image i want make some imagte prossessing as ( 1- i want to make two image from the original image 2- the first image have (50*50) cordinate 3- the secode image have (200*200) as max hight and max wiedth 4-i want for each image to take new name ) u can see example in this site http://www.blocket.se/vi/7874861.htm?ca=10\_s u can see tow image one small and one big how can do as this in my site Palestine

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      You can use the classes in System.Drawing and System.Drawing.Drawing2D namespaces to manipulate images. You can use System.IO.Path.GetTempFile method to create and return a unique file on disk. If you need more specific answers, please post a more specific question or problem.

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: I luv teh choco The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      1 Reply Last reply
      0
      • T TAREQ F ABUZUHRI

        in my site i have form to upload image this image may be very big or very small but after user upload this image i want make some imagte prossessing as ( 1- i want to make two image from the original image 2- the first image have (50*50) cordinate 3- the secode image have (200*200) as max hight and max wiedth 4-i want for each image to take new name ) u can see example in this site http://www.blocket.se/vi/7874861.htm?ca=10\_s u can see tow image one small and one big how can do as this in my site Palestine

        B Offline
        B Offline
        babamara
        wrote on last edited by
        #3

        try something like this Stream imgStream = UploadFile.PostedFile.InputStream; int imgLen = UploadFile.PostedFile.ContentLength; string imgContentType = UploadFile.PostedFile.ContentType; string imgName = txtImgName.Value; byte[] imgBinaryData = new byte[imgLen]; int n = imgStream.Read(imgBinaryData,0,imgLen); //thumb MemoryStream stream = new MemoryStream(); System.Drawing.Image thumb = System.Drawing.Image.FromStream(imgStream); System.Drawing.Image thumbnail = thumb.GetThumbnailImage(50, 50, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero); thumbnail.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] thumbBinaryData = new byte[stream.Length]; stream.Position = 0; int m = stream.Read(thumbBinaryData, 0, (int)stream.Length); // SaveToDB(imgName, imgBinaryData, imgContentType, thumbBinaryData); Good luck :) -- modified at 8:12 Sunday 16th April, 2006

        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