Last post Jul 25, 2008 09:47 AM by nmeighty
Jul 23, 2008 05:25 AM|nmeighty|LINK
Its common need to show images of one product in different imag sizes like 50X50 ,80X80 and even 500X500. So some people use to save thumbnails in different width and heights at the time of uploading.
Is this possible that we can use following syntax to generate thumbnail?
<img border="0" src="http://mywebisteurl/thumbnail.aspx?pic=uplimg/img.gif&w=80&sq=Y&/> (I have seen some website's html and it was from there)
The things to notice are in the source attribute of Img tag. I am giving address of my page which will generate thumbnail of width ' w =80' and then I am specifying 'sq=Y' which means that it should
be of square type i-e width==height)
I don't know what should I do in thumbnail.aspx page and how to return image. Please help me in how to generate best thumbnail and how to use them
Jul 23, 2008 07:24 AM|XIII|LINK
take a look at this code:
Jul 23, 2008 08:29 AM|nmeighty|LINK
Hi Grz, Kris, Thanks for the reply. Please cay you guide me how to call this code . I made a
test.aspx page and copied code from
http://west-wind.com/weblog/posts/283.aspx. Then I am trying to call
test.aspx page (responsible for returning thumbnail) from
default.aspx as follows as follows
But no result is returned...
Jul 23, 2008 08:37 AM|nmeighty|LINK
A quick one ...I am able to call the test.aspx from default.aspx page. I dont know why it was not calling earlier.I didnt changed anything but again rebuild and it started calling test.aspx. But I am having problem that everytime I get the same Image size from
Jul 23, 2008 08:43 AM|nmeighty|LINK
the method below is the cause. I think that the logic is that it only returns thumbnail if the requested thumbnail is of smaller size then that of original Image. However I want to get the
thumbnail(or whatever it will be called) even if its of bigger size then that of original image.Please guide
Bitmap CreateThumbnail(string lcFilename,
//*** If the image is smaller than a thumbnail just return it
Jul 23, 2008 09:06 AM|XIII|LINK
does test.aspx, when you call it directly in your browser with that querystring return something? If not place breakpoints in the code and see where things don't return anything anymore. This is a job that you'll have to perform first.
Jul 23, 2008 09:31 AM|nmeighty|LINK
actually I am calling test.aspx from Default.aspx as follows
Also I can directly call test.aspx?Image=images/Pic2.jpg&size=50& the browser.
I can successfully go into debug mode and further can go through all the coding in test.aspx.cs file.
Example: Consider we have a Original.jpg (of 100X100) in Images folder. Your mentioned example website code will always work fine if we request for thumbnail like 50X50 or BXB(wher B must be less then the orginal size(100X100) of Original.jpg
). But If we will request for 200X200 or anything greater then 100X100(original size) it will return original image.
Now I want the functionlaty that if if ask for BXB image and B can be greater then Original Image evern then we should get image
Hope you understand.
Jul 25, 2008 09:47 AM|nmeighty|LINK
Is there any one ....The code above is working fine if we want to generate thumbnail(i-e smaller image then the original one),But I also want to get a bigger image when required.The above code use to return original image if we request for a bigger image
then itself. Please help