AspAlliance.com LogoASPAlliance: Articles, reviews, and samples for .NET Developers
URL:
http://aspalliance.com/articleViewer.aspx?aId=404&pId=-1
Image Web Service
page
by Chris Garrett
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 17872/ 29

Image Web Service

This is a practical example of how a web service can use GDI+ functionality to return image data and how you can then consume this web service.

The web service creates an image based on the requested text, font, alignment and colours that you supply in a call to the DrawText webmethod.

Your image data is then returned as an array of bytes which you then must reconstruct in your client application using an input stream.

As you will see if you view the source, the client application is very simple. This code could be simplified even further by putting the stream and bitmap creation code into a custom proxy rather than relying on the proxy created by the .NET command line tools.

To use the web service in your own applications, download the .dll and put it in your web application bin directory or add a web reference in Visual Studio.NET

 

Try it out
/chrisg/tools/testtextgraphic.aspx
/chrisg/tools/textgraphic.asmx

View Source
/chrisg/tools/view-testtextgraphic.aspx.asp
/chrisg/tools/view-textgraphic.asmx.asp

Download
/chrisg/tools/download.asp?file=testtextgraphic.aspx
/chrisg/tools/download.asp?file=textgraphic.asmx
/chrisg/tools/download.asp?file=textGraphicProxy.dll


Product Spotlight
Product Spotlight 

©Copyright 1998-2020 ASPAlliance.com  |  Page Processed at 2020-07-05 10:44:08 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search