Display Images vertically via web service

P

Peter Lapic

I have to create a image web service that when it receives an imageid
parameter it will return a gif image from a file that has been stored on the
server.

The client will be an asp.net web page that calls the web service to render
a vertical strip of images.

After doing some research I am unable to find some vb.net code that can
assist in what I want to achieve.
The closest thing I found was
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmsde2kwrk/html/mypicsvbvs.asp.

However its too complicated for me to work out the bits I really need. I
believe the web service needs to stream the image and the asp.net page
consumes this. Am I on the right track? Do I need to use IHttpHandler?

Can someone show me a basic code sample in vb.net so that I get images to
appear vertically as such:

Image #1
Image #2
::
::
Image #n

Regards
Peter
 
M

Matthew

Is there a reason it needs to be a webservice ?

just make an aspx page that changes the headers of the responce to

Content-Type: image/jpeg
then writes out the binary image to the response stream.

In your page would be:
<img src="image.aspx?id=5"> and that would grab the image from the ASPX.
 
P

Peter Lapic

Thanks Matthew. The web service is designed to generate the images.
The source comes from vector based files that require conversions.
Since these files can change at any given time, the latest image must be
presented.
So the web services acts as a graphics layer much like database acts as a
data layer.

The client is foremost layer and must be separate from the complexity of the
graphics process.
So I really do need some sort of streaming mechanism.

Regards
Peter
 
S

Steven Cheng[MSFT]

Hi Peter,

For such scenario, I think using ASP.NET HttpHandler to build such a image
generator service is the perfered approach. We can put the data accessing
code in httphandler's processMessage code to retrieve image streams and
flush them out .... Then, other pages can reference the httphandler's url
(which use querystring parameters to specify certain code logic
options....). Also, the ASP.NET 2.0's WebResource.axd is just such a
HttpHandler which help retreive resources from assembly and flush it
out....

Here are two web articles discussing on building a Image generation
httphandler in ASP.NET:

#A simple ASP.NET photo album
http://weblogs.asp.net/bleroy/archive/2005/09/08/424714.aspx

#Using ASP.NET HTTP Handlers to create a photo album
http://www.microsoft.com/belux/nl/msdn/community/columns/desmet/httphandler.
mspx

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "Peter Lapic" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Display Images vertically via web service
| Date: Tue, 3 Jan 2006 15:11:50 +1000
| Lines: 59
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Response
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 61.88.17.230
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368170
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks Matthew. The web service is designed to generate the images.
| The source comes from vector based files that require conversions.
| Since these files can change at any given time, the latest image must be
| presented.
| So the web services acts as a graphics layer much like database acts as a
| data layer.
|
| The client is foremost layer and must be separate from the complexity of
the
| graphics process.
| So I really do need some sort of streaming mechanism.
|
| Regards
| Peter
|
| | > Is there a reason it needs to be a webservice ?
| >
| > just make an aspx page that changes the headers of the responce to
| >
| > Content-Type: image/jpeg
| > then writes out the binary image to the response stream.
| >
| > In your page would be:
| > <img src="image.aspx?id=5"> and that would grab the image from the ASPX.
| >
| >
| >
| >
| > Peter Lapic wrote:
| >> I have to create a image web service that when it receives an imageid
| >> parameter it will return a gif image from a file that has been stored
on
| >> the server.
| >>
| >> The client will be an asp.net web page that calls the web service to
| >> render a vertical strip of images.
| >>
| >> After doing some research I am unable to find some vb.net code that
can
| >> assist in what I want to achieve.
| >> The closest thing I found was
| >>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmsde2kwrk
/html/mypicsvbvs.asp.
| >>
| >> However its too complicated for me to work out the bits I really need.
I
| >> believe the web service needs to stream the image and the asp.net page
| >> consumes this. Am I on the right track? Do I need to use IHttpHandler?
| >>
| >> Can someone show me a basic code sample in vb.net so that I get images
to
| >> appear vertically as such:
| >>
| >> Image #1
| >> Image #2
| >> ::
| >> ::
| >> Image #n
| >>
| >> Regards
| >> Peter
|
|
|
 
S

Steven Cheng[MSFT]

Hi Peter,

How are you doing on this issue or does my last reply helps you a little?
If there're anything else we can help, please feel free to post here.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 215291606
| References: <[email protected]>
<[email protected]>
<[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Tue, 03 Jan 2006 07:46:47 GMT
| Subject: Re: Display Images vertically via web service
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 100
| Path: TK2MSFTNGXA02.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368194
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi Peter,
|
| For such scenario, I think using ASP.NET HttpHandler to build such a
image
| generator service is the perfered approach. We can put the data accessing
| code in httphandler's processMessage code to retrieve image streams and
| flush them out .... Then, other pages can reference the httphandler's
url
| (which use querystring parameters to specify certain code logic
| options....). Also, the ASP.NET 2.0's WebResource.axd is just such a
| HttpHandler which help retreive resources from assembly and flush it
| out....
|
| Here are two web articles discussing on building a Image generation
| httphandler in ASP.NET:
|
| #A simple ASP.NET photo album
| http://weblogs.asp.net/bleroy/archive/2005/09/08/424714.aspx
|
| #Using ASP.NET HTTP Handlers to create a photo album
|
http://www.microsoft.com/belux/nl/msdn/community/columns/desmet/httphandler.
| mspx
|
| Hope helps. Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
| --------------------
| | From: "Peter Lapic" <[email protected]>
| | References: <[email protected]>
| <[email protected]>
| | Subject: Re: Display Images vertically via web service
| | Date: Tue, 3 Jan 2006 15:11:50 +1000
| | Lines: 59
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| | X-RFC2646: Format=Flowed; Response
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| | Message-ID: <[email protected]>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | NNTP-Posting-Host: 61.88.17.230
| | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| | Xref: TK2MSFTNGXA02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:368170
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | Thanks Matthew. The web service is designed to generate the images.
| | The source comes from vector based files that require conversions.
| | Since these files can change at any given time, the latest image must
be
| | presented.
| | So the web services acts as a graphics layer much like database acts as
a
| | data layer.
| |
| | The client is foremost layer and must be separate from the complexity
of
| the
| | graphics process.
| | So I really do need some sort of streaming mechanism.
| |
| | Regards
| | Peter
| |
| | | | > Is there a reason it needs to be a webservice ?
| | >
| | > just make an aspx page that changes the headers of the responce to
| | >
| | > Content-Type: image/jpeg
| | > then writes out the binary image to the response stream.
| | >
| | > In your page would be:
| | > <img src="image.aspx?id=5"> and that would grab the image from the
ASPX.
| | >
| | >
| | >
| | >
| | > Peter Lapic wrote:
| | >> I have to create a image web service that when it receives an
imageid
| | >> parameter it will return a gif image from a file that has been
stored
| on
| | >> the server.
| | >>
| | >> The client will be an asp.net web page that calls the web service to
| | >> render a vertical strip of images.
| | >>
| | >> After doing some research I am unable to find some vb.net code that
| can
| | >> assist in what I want to achieve.
| | >> The closest thing I found was
| | >>
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmsde2kwrk
| /html/mypicsvbvs.asp.
| | >>
| | >> However its too complicated for me to work out the bits I really
need.
| I
| | >> believe the web service needs to stream the image and the asp.net
page
| | >> consumes this. Am I on the right track? Do I need to use
IHttpHandler?
| | >>
| | >> Can someone show me a basic code sample in vb.net so that I get
images
| to
| | >> appear vertically as such:
| | >>
| | >> Image #1
| | >> Image #2
| | >> ::
| | >> ::
| | >> Image #n
| | >>
| | >> Regards
| | >> Peter
| |
| |
| |
|
|
 
S

Steven Cheng[MSFT]

Hi Peter,

We've received your mail and according to your current question(displaying
image vertically), here are some of my understanding on this:

Are you wantting to display serveral image vertically in a single DataGrid
cell? Also, if the image counts in each cell is fixed, we can just put a
html <table> to structure the <img> tags and peform databinding, else if
the counts is not fixed, we may need to use a n additional template
databound control (like Repeater ) to display those images....

BTW, since you're currently using a webservice together with a asp.net page
to output the image as binary stream, why don't you just use an HTTPhandler
to retrieve image bytes and output them as binary image stream as mentioned
in those articles provided in my last reply?

Please let me know if anything I didn't quite get. If convenient, you can
make a complete static html page to show what you want your client page to
finally display...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| X-Tomcat-ID: 224302808
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Thu, 05 Jan 2006 09:49:46 GMT
| Subject: Re: Display Images vertically via web service
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 135
| Path: TK2MSFTNGXA02.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368691
| NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
|
| Hi Peter,
|
| How are you doing on this issue or does my last reply helps you a little?
| If there're anything else we can help, please feel free to post here.
|
| Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
| --------------------
| | X-Tomcat-ID: 215291606
| | References: <[email protected]>
| <[email protected]>
| <[email protected]>
| | MIME-Version: 1.0
| | Content-Type: text/plain
| | Content-Transfer-Encoding: 7bit
| | From: (e-mail address removed) (Steven Cheng[MSFT])
| | Organization: Microsoft
| | Date: Tue, 03 Jan 2006 07:46:47 GMT
| | Subject: Re: Display Images vertically via web service
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| | Message-ID: <[email protected]>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | Lines: 100
| | Path: TK2MSFTNGXA02.phx.gbl
| | Xref: TK2MSFTNGXA02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:368194
| | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
| |
| | Hi Peter,
| |
| | For such scenario, I think using ASP.NET HttpHandler to build such a
| image
| | generator service is the perfered approach. We can put the data
accessing
| | code in httphandler's processMessage code to retrieve image streams and
| | flush them out .... Then, other pages can reference the httphandler's
| url
| | (which use querystring parameters to specify certain code logic
| | options....). Also, the ASP.NET 2.0's WebResource.axd is just such a
| | HttpHandler which help retreive resources from assembly and flush it
| | out....
| |
| | Here are two web articles discussing on building a Image generation
| | httphandler in ASP.NET:
| |
| | #A simple ASP.NET photo album
| | http://weblogs.asp.net/bleroy/archive/2005/09/08/424714.aspx
| |
| | #Using ASP.NET HTTP Handlers to create a photo album
| |
|
http://www.microsoft.com/belux/nl/msdn/community/columns/desmet/httphandler.
| | mspx
| |
| | Hope helps. Thanks,
| |
| | Steven Cheng
| | Microsoft Online Support
| |
| | Get Secure! www.microsoft.com/security
| | (This posting is provided "AS IS", with no warranties, and confers no
| | rights.)
| |
| |
| | --------------------
| | | From: "Peter Lapic" <[email protected]>
| | | References: <[email protected]>
| | <[email protected]>
| | | Subject: Re: Display Images vertically via web service
| | | Date: Tue, 3 Jan 2006 15:11:50 +1000
| | | Lines: 59
| | | X-Priority: 3
| | | X-MSMail-Priority: Normal
| | | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| | | X-RFC2646: Format=Flowed; Response
| | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| | | Message-ID: <[email protected]>
| | | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | | NNTP-Posting-Host: 61.88.17.230
| | | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| | | Xref: TK2MSFTNGXA02.phx.gbl
| | microsoft.public.dotnet.framework.aspnet:368170
| | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| | |
| | | Thanks Matthew. The web service is designed to generate the images.
| | | The source comes from vector based files that require conversions.
| | | Since these files can change at any given time, the latest image must
| be
| | | presented.
| | | So the web services acts as a graphics layer much like database acts
as
| a
| | | data layer.
| | |
| | | The client is foremost layer and must be separate from the complexity
| of
| | the
| | | graphics process.
| | | So I really do need some sort of streaming mechanism.
| | |
| | | Regards
| | | Peter
| | |
| | | | | | > Is there a reason it needs to be a webservice ?
| | | >
| | | > just make an aspx page that changes the headers of the responce to
| | | >
| | | > Content-Type: image/jpeg
| | | > then writes out the binary image to the response stream.
| | | >
| | | > In your page would be:
| | | > <img src="image.aspx?id=5"> and that would grab the image from the
| ASPX.
| | | >
| | | >
| | | >
| | | >
| | | > Peter Lapic wrote:
| | | >> I have to create a image web service that when it receives an
| imageid
| | | >> parameter it will return a gif image from a file that has been
| stored
| | on
| | | >> the server.
| | | >>
| | | >> The client will be an asp.net web page that calls the web service
to
| | | >> render a vertical strip of images.
| | | >>
| | | >> After doing some research I am unable to find some vb.net code
that
| | can
| | | >> assist in what I want to achieve.
| | | >> The closest thing I found was
| | | >>
| |
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmsde2kwrk
| | /html/mypicsvbvs.asp.
| | | >>
| | | >> However its too complicated for me to work out the bits I really
| need.
| | I
| | | >> believe the web service needs to stream the image and the asp.net
| page
| | | >> consumes this. Am I on the right track? Do I need to use
| IHttpHandler?
| | | >>
| | | >> Can someone show me a basic code sample in vb.net so that I get
| images
| | to
| | | >> appear vertically as such:
| | | >>
| | | >> Image #1
| | | >> Image #2
| | | >> ::
| | | >> ::
| | | >> Image #n
| | | >>
| | | >> Regards
| | | >> Peter
| | |
| | |
| | |
| |
| |
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top