Showing posts with label images. Show all posts
Showing posts with label images. Show all posts

Saturday, March 31, 2012

Set bit depth of an image

Hi. I haven't been able to get an answer in the vb newsgroup on the topic,
so I'll try here. I'm converting .tif images into other image formats like
..jpeg and .gif and I need to know how I can control the bit depth of these
images. The System.Drawing.Image object's default bit depth when saving
images seems to be 24 for .jpeg and 8 for .gif.

Thanks,
Shawnuse CxImage library, better than .nets...

http://www.aoi.it/download.html

"Shawn" <bossman100@.hotmail.com> wrote in message
news:%23c8isWgQDHA.2212@.TK2MSFTNGP12.phx.gbl...
> Hi. I haven't been able to get an answer in the vb newsgroup on the
topic,
> so I'll try here. I'm converting .tif images into other image formats
like
> .jpeg and .gif and I need to know how I can control the bit depth of these
> images. The System.Drawing.Image object's default bit depth when saving
> images seems to be 24 for .jpeg and 8 for .gif.
> Thanks,
> Shawn

Monday, March 26, 2012

set Expires tag for images?

Hi - I want to reduce the download time of various pages by setting the
'Expires' tag for various images to a future date (this will then stop the
browser from re-requesting these for each new session).

I'm hosting on a commercial service so I don't have direct access to IIS
configuration. Is there anyway I can control this from my server-side code?

Thanks,

Paul.Paul W wrote:

> Hi - I want to reduce the download time of various pages by setting
> the 'Expires' tag for various images to a future date (this will then
> stop the browser from re-requesting these for each new session).
> I'm hosting on a commercial service so I don't have direct access to
> IIS configuration. Is there anyway I can control this from my
> server-side code?

Not if the images are served directly by IIS. Your ISP should be able
to change the server configuration to allow for caching.

BTW, you should prefer Cache-Control: max-age over Expires.

Cheers,
--
http://www.joergjooss.de
mailto:news-reply@.joergjooss.de
Currently the images ARE directly served by IIS. Can you point me to how
else I could do this so I can set the "Cache-Control: max-age"? Thanks,

Paul.
----
"Joerg Jooss" <news-reply@.joergjooss.de> wrote in message
news:xn0e3b26b6h8ll002@.msnews.microsoft.com...
> Paul W wrote:
>> Hi - I want to reduce the download time of various pages by setting
>> the 'Expires' tag for various images to a future date (this will then
>> stop the browser from re-requesting these for each new session).
>>
>> I'm hosting on a commercial service so I don't have direct access to
>> IIS configuration. Is there anyway I can control this from my
>> server-side code?
> Not if the images are served directly by IIS. Your ISP should be able
> to change the server configuration to allow for caching.
> BTW, you should prefer Cache-Control: max-age over Expires.
> Cheers,
> --
> http://www.joergjooss.de
> mailto:news-reply@.joergjooss.de
Paul W wrote:

> Currently the images ARE directly served by IIS. Can you point me to
> how else I could do this so I can set the "Cache-Control: max-age"?
> Thanks,

You could implemment a HttpHandler that serves your images, but this is
really a waste of time. Ask your service provider to change your IIS
configuration.

Cheers,
--
http://www.joergjooss.de
mailto:news-reply@.joergjooss.de

Set flash src property to an aspx page?

We have a website that displays images by way of a general purpose
aspx page. We do this because we can't (for security purposes) have
the images in a publicly accessible area that can be referenced
directly via a browser. So, the src of our image tags goes something
like "src=GetFile.aspx?id=1234". I want to do the same thing
with .SWF files, but wanted to know if the flash plug-in would accept
a file for its source that wasn't an .SWF file. Any help would be
much appreciated.
Thanks!Yes. Since you are indeed feeding it an SWF file (albeit with a different
file extension) it should work.
Here's more info:
http://SteveOrr.net/articles/Flasher.aspx
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
<noneya22@.excite.com> wrote in message
news:1178573709.215168.273760@.y80g2000hsf.googlegroups.com...
> We have a website that displays images by way of a general purpose
> aspx page. We do this because we can't (for security purposes) have
> the images in a publicly accessible area that can be referenced
> directly via a browser. So, the src of our image tags goes something
> like "src=GetFile.aspx?id=1234". I want to do the same thing
> with .SWF files, but wanted to know if the flash plug-in would accept
> a file for its source that wasn't an .SWF file. Any help would be
> much appreciated.
> Thanks!
>

Thursday, March 22, 2012

Set Image Control to Bitmap

Hello All, want to be able to pull images from the database and load them
into a bitmap through a stream which I have working. I then want to take
the bitmap and load it into a Image control without haveing to save the
bitmap as a file. Is this possible? Currently, I just display the bitmap
by calling Bitmap.save however, if users do not know to click the image they
can not see the full size. If I can create a bitmap from the stream I know
the size so I can set the properties of a image control and then display the
bitmap in the image. Does this make since or am I going about this the
wrong way? So in a nutshell, I am pulling images from a DB and want to
display the full size without having to actuall save the image to a file.
Any pointers?
TIAYou can make an mypage.aspx page that returns bitmap (not HTML)
1. You need to set ContentType = "img/gif"; or (jpg)
2. You need to set ContentLength to the size of the image
3. Use Response.BinaryWrite to output the image. Or since Response is a
Stream you can do Bitmap.Save(Response);
in your HTML you write <img src="http://pics.10026.com/?src=mypage.aspx">
PS: It's more efficient to use handler for that task. mypage.ashx. But aspx
will work too if you fill more comfortable with aspx.
George.
"MikeB" <m@.nospam.com> wrote in message
news:usruSre3HHA.1164@.TK2MSFTNGP02.phx.gbl...
> Hello All, want to be able to pull images from the database and load them
> into a bitmap through a stream which I have working. I then want to take
> the bitmap and load it into a Image control without haveing to save the
> bitmap as a file. Is this possible? Currently, I just display the bitmap
> by calling Bitmap.save however, if users do not know to click the image
> they can not see the full size. If I can create a bitmap from the stream
> I know the size so I can set the properties of a image control and then
> display the bitmap in the image. Does this make since or am I going about
> this the wrong way? So in a nutshell, I am pulling images from a DB and
> want to display the full size without having to actuall save the image to
> a file. Any pointers?
> TIA
>
Here is a way to do this without relying on an external handler such as
another page:
http://www.eggheadcafe.com/articles/20050911.asp
-Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
"MikeB" wrote:

> Hello All, want to be able to pull images from the database and load them
> into a bitmap through a stream which I have working. I then want to take
> the bitmap and load it into a Image control without haveing to save the
> bitmap as a file. Is this possible? Currently, I just display the bitmap
> by calling Bitmap.save however, if users do not know to click the image th
ey
> can not see the full size. If I can create a bitmap from the stream I kno
w
> the size so I can set the properties of a image control and then display t
he
> bitmap in the image. Does this make since or am I going about this the
> wrong way? So in a nutshell, I am pulling images from a DB and want to
> display the full size without having to actuall save the image to a file.
> Any pointers?
> TIA
>
>
Your page can have an Image control on it, and that Image control can point
to another page (or handler) that retrieves the image.
Here are the details:
http://SteveOrr.net/articles/ImproveYourImages.aspx
http://dotnetslackers.com/articles/...FileDenial.aspx
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"MikeB" <m@.nospam.com> wrote in message
news:usruSre3HHA.1164@.TK2MSFTNGP02.phx.gbl...
> Hello All, want to be able to pull images from the database and load them
> into a bitmap through a stream which I have working. I then want to take
> the bitmap and load it into a Image control without haveing to save the
> bitmap as a file. Is this possible? Currently, I just display the bitmap
> by calling Bitmap.save however, if users do not know to click the image
> they can not see the full size. If I can create a bitmap from the stream
> I know the size so I can set the properties of a image control and then
> display the bitmap in the image. Does this make since or am I going about
> this the wrong way? So in a nutshell, I am pulling images from a DB and
> want to display the full size without having to actuall save the image to
> a file. Any pointers?
> TIA
>
Thanks everyone for the replies.
"MikeB" <m@.nospam.com> wrote in message
news:usruSre3HHA.1164@.TK2MSFTNGP02.phx.gbl...
> Hello All, want to be able to pull images from the database and load them
> into a bitmap through a stream which I have working. I then want to take
> the bitmap and load it into a Image control without haveing to save the
> bitmap as a file. Is this possible? Currently, I just display the bitmap
> by calling Bitmap.save however, if users do not know to click the image
> they can not see the full size. If I can create a bitmap from the stream
> I know the size so I can set the properties of a image control and then
> display the bitmap in the image. Does this make since or am I going about
> this the wrong way? So in a nutshell, I am pulling images from a DB and
> want to display the full size without having to actuall save the image to
> a file. Any pointers?
> TIA
>

Set Image Control to Bitmap

Hello All, want to be able to pull images from the database and load them
into a bitmap through a stream which I have working. I then want to take
the bitmap and load it into a Image control without haveing to save the
bitmap as a file. Is this possible? Currently, I just display the bitmap
by calling Bitmap.save however, if users do not know to click the image they
can not see the full size. If I can create a bitmap from the stream I know
the size so I can set the properties of a image control and then display the
bitmap in the image. Does this make since or am I going about this the
wrong way? So in a nutshell, I am pulling images from a DB and want to
display the full size without having to actuall save the image to a file.
Any pointers?

TIAYou can make an mypage.aspx page that returns bitmap (not HTML)
1. You need to set ContentType = "img/gif"; or (jpg)
2. You need to set ContentLength to the size of the image
3. Use Response.BinaryWrite to output the image. Or since Response is a
Stream you can do Bitmap.Save(Response);

in your HTML you write <img src="http://pics.10026.com/?src=mypage.aspx">

PS: It's more efficient to use handler for that task. mypage.ashx. But aspx
will work too if you fill more comfortable with aspx.

George.

"MikeB" <m@.nospam.comwrote in message
news:usruSre3HHA.1164@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hello All, want to be able to pull images from the database and load them
into a bitmap through a stream which I have working. I then want to take
the bitmap and load it into a Image control without haveing to save the
bitmap as a file. Is this possible? Currently, I just display the bitmap
by calling Bitmap.save however, if users do not know to click the image
they can not see the full size. If I can create a bitmap from the stream
I know the size so I can set the properties of a image control and then
display the bitmap in the image. Does this make since or am I going about
this the wrong way? So in a nutshell, I am pulling images from a DB and
want to display the full size without having to actuall save the image to
a file. Any pointers?
>
TIA
>


Here is a way to do this without relying on an external handler such as
another page:

http://www.eggheadcafe.com/articles/20050911.asp
-Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
"MikeB" wrote:

Quote:

Originally Posted by

Hello All, want to be able to pull images from the database and load them
into a bitmap through a stream which I have working. I then want to take
the bitmap and load it into a Image control without haveing to save the
bitmap as a file. Is this possible? Currently, I just display the bitmap
by calling Bitmap.save however, if users do not know to click the image they
can not see the full size. If I can create a bitmap from the stream I know
the size so I can set the properties of a image control and then display the
bitmap in the image. Does this make since or am I going about this the
wrong way? So in a nutshell, I am pulling images from a DB and want to
display the full size without having to actuall save the image to a file.
Any pointers?
>
TIA
>
>
>


Your page can have an Image control on it, and that Image control can point
to another page (or handler) that retrieves the image.
Here are the details:
http://SteveOrr.net/articles/ImproveYourImages.aspx
http://dotnetslackers.com/articles/...FileDenial.aspx
--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"MikeB" <m@.nospam.comwrote in message
news:usruSre3HHA.1164@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hello All, want to be able to pull images from the database and load them
into a bitmap through a stream which I have working. I then want to take
the bitmap and load it into a Image control without haveing to save the
bitmap as a file. Is this possible? Currently, I just display the bitmap
by calling Bitmap.save however, if users do not know to click the image
they can not see the full size. If I can create a bitmap from the stream
I know the size so I can set the properties of a image control and then
display the bitmap in the image. Does this make since or am I going about
this the wrong way? So in a nutshell, I am pulling images from a DB and
want to display the full size without having to actuall save the image to
a file. Any pointers?
>
TIA
>


Thanks everyone for the replies.

"MikeB" <m@.nospam.comwrote in message
news:usruSre3HHA.1164@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hello All, want to be able to pull images from the database and load them
into a bitmap through a stream which I have working. I then want to take
the bitmap and load it into a Image control without haveing to save the
bitmap as a file. Is this possible? Currently, I just display the bitmap
by calling Bitmap.save however, if users do not know to click the image
they can not see the full size. If I can create a bitmap from the stream
I know the size so I can set the properties of a image control and then
display the bitmap in the image. Does this make since or am I going about
this the wrong way? So in a nutshell, I am pulling images from a DB and
want to display the full size without having to actuall save the image to
a file. Any pointers?
>
TIA
>