locked
how can i cache image RRS feed

  • Question

  • User-2082836469 posted
    how can i cache image Dim currImage As System.Drawing.Image currImage = System.Drawing.Image.FromFile(Server.MapPath(imgDir) & fileName) width = imgWidth height = imgHeight Dim dmCB As System.Drawing.Image.GetThumbnailImageAbort dmCB = New System.Drawing.Image.GetThumbnailImageAbort(AddressOf tmCB) currImage = currImage.GetThumbnailImage(width, height, dmCB, IntPtr.Zero) currImage.Save(Response.OutputStream, ImageFormat.Jpeg) its working but when i want delete or change image i give exeption System.IO.IOException: The process cannot access the file "C:\...\img.jpg" because it is being used by another process.
    Monday, July 5, 2004 5:37 PM

All replies

  • User-2082836469 posted
    OK i resolve it Dim currImage As System.Drawing.Image currImage = System.Drawing.Image.FromFile(Server.MapPath(imgDir) & fileName) width = imgWidth height = imgHeight Dim dmCB As System.Drawing.Image.GetThumbnailImageAbort dmCB = New System.Drawing.Image.GetThumbnailImageAbort(AddressOf tmCB) 'change this part Dim thmb As System.Drawing.Image = currImage.GetThumbnailImage(width, height, dmCB, IntPtr.Zero) thmb.Save(Response.OutputStream, ImageFormat.Jpeg) thmb.dispose() currImage.dispose() '-------------- its ok and working
    Monday, July 5, 2004 7:09 PM
  • User-2082836469 posted
    tiutorial: http://www.microsoft.com/belux/nl/msdn/community/columns/desmet/httphandler.mspx
    Monday, July 5, 2004 7:17 PM