Re: Image size question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Sun, 03 Apr 2005 08:25:09 -0700, Brock Allen
<ballen@xxxxxxxxxxxxxxxxx> wrote:

>I have a sample app that does exactly that:
>
>http://staff.develop.com/ballen/blog/PermaLink.aspx?guid=2d8b430b-8361-416d-9df8-9aff48bf2481
>
>I'd suggest reading the comments for the blog entry and there's a link off
>to more help on the image resizing bit.
>
>-Brock
>DevelopMentor
>http://staff.develop.com/ballen
>
>
>
>> I have an app that has many subdirectories containing one or more
>> images (jpg, gif, bmp). When the user selects a directory, my plan is
>> to show the images if there are only one or two, or show thumbnails if
>> there are more and allow the user to click on each thumbnail to view
>> it full size.
>>
>> Right now I'm just sticking an <IMG> tag for each image into a literal
>> control. It works fine but the images are huge which surprised me. I
>> really don't know the size of the image in order to specify height and
>> width in the IMG tag. I tried loading them and checking the
>> image.height and width but, after around 6 or 7 it runs out of memory.
>> Very weird. I am disposing the image after each one is loaded.
>>
>> But that approach is very wasteful anyway. There can't be a need to
>> load each image just to get the browser to display it at the proper
>> size. Should I try adding image controls dynamically instead of
>> spitting out html? Am I missing the point entirely?
>>
>> The thumbnail idea also presents the same problem. It seems wasteful
>> to load an image and generate the thumbnail in memory each time. I
>> guess I can check to see if the thumbnails exist and if not create
>> them. That way I only do it once or can even have a separate app do it
>> "offline".
>>
>> Any image assistance appreciated.
>>
>
>

Thanks. It will take me a bit to sort though this. Setting the
contextType:
ctx.Response.ContentType = "image/jpeg";

tells the browser not the expect a webpage but rather an image. And
this line:
img2.Save(ctx.Response.OutputStream,System.Drawing.Imaging.ImageFormat.Jpeg);

spits it out.

But does it appear somewhere in the current webpage or open up a new
window? And how would I attach JavaScript to trigger a request for the
full image?
.



Relevant Pages

  • Re: Creating Thumbnail image of a webpage ?
    ... for is "Create a small image (Thumbnail) of a webpage. ... PHP is not a browser, so it has no clue how to handle HTML/CSS/etc., so it would have to be told this. ... Then you could fire open a quick instance of whatever browser or COM instance you desire, fire a snapshot utility, save that and resample with PHP's image functions, GD or ImageMagick. ...
    (comp.lang.php)
  • Re: view
    ... You didn't include the app you're using or the version, but I'm guessing it's this issue with Word 2002 from Office XP. ... when you open a document for example and you try to insert a picture the ... view we get is thumbnail, we want it to be detail view. ...
    (microsoft.public.office.misc)
  • Image size question
    ... I have an app that has many subdirectories containing one or more ... But that approach is very wasteful anyway. ... The thumbnail idea also presents the same problem. ... to load an image and generate the thumbnail in memory each time. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Display .jpg thumbnails in ListView
    ... jpg files within a specified directory. ... Ideally I would like each thumbnail to be ... I have a very old VB6 app that does this (by using an imagelist control to ...
    (microsoft.public.dotnet.languages.vb.controls)
  • Re: Access 2010 with Sharepoint 2010
    ... the browser as in Access itself? ... I've said elsewhere that I'm wary of embedded macros because of the ... An existing app ... that when I deploy to the client system, ...
    (comp.databases.ms-access)