Hi,
I'm using an asp.net page to dynamically create thumbnails, and I was thinking I should try and cache them to load them a bit faster. I've never tried using the Cache object before, but I'm sure it should work like I'm trying to use it. Anyway, here's the code for caching and retrieving the thumbnail:
VB Code:
Dim bmp As Bitmap = Cache.Get(strPath & "_" & sWidth & "_" & sHeight) If bmp Is Nothing Then bmp = CreateThumbnail(strPath, sWidth, sHeight) Cache.Insert(strPath & "_" & sWidth & "_" & sHeight, _ bmp, Nothing, DateTime.MaxValue, TimeSpan.Zero) End If If bmp Is String.Empty Then Return
strPath is the location of the photo, sWidth the width and sHeight the height. The thumbnail is then saved to the output stream. Unfortunately, this doesn't seem to work.
Any ideas?




Reply With Quote