Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Drawing / December 2003

Tip: Looking for answers? Try searching our database.

Use GDI+ on the Web

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
O_awwad - 28 Dec 2003 16:54 GMT
can i use GDI+ to draw a line ( for example ) on a web
page ( or a web form ) ?

thanks for any help

telbana2@yahoo.com
Gerben van Loon - 28 Dec 2003 21:06 GMT
Yeah sure, only you need something to draw on first. For example a bitmap,
and then send that bitmap back to the browser. For example:

Bitmap _bmp = new Bitmap(250,250);
Graphics g = Graphics.FromImage(_bmp);
Pen _pen = new Pen(Brushes.Blue,10);
g.DrawLine(_pen,10,10,150,150);
_bmp.Save(Response.OutputStream, ImageFormat.Jpeg);
g.Dispose();

Only problem is that after calling the "_bmp.Save(Response.OutputStream,
ImageFormat.Jpeg);" al other controls which were on the page disappear. Mayb
someone can help me with that?

Cheers,

Gerben.

> can i use GDI+ to draw a line ( for example ) on a web
> page ( or a web form ) ?
>
> thanks for any help
>
> telbana2@yahoo.com
James Westgate \(Crainiate\) - 29 Dec 2003 13:46 GMT
Since an image on a page is a seperate http request, you can create an
imagewriter page and use that to process dynamic images. Set the src of a
normal image to an .aspx page eg

<img src='imagewriter.aspx?path=value'>

You may also have to set the content type to the image format eg jpeg

Response.ContentType = "image/jpg"

James

Signature

Create interactive flowcharts, diagrams and UML models with ERM3 at
http://www.crainiate.net

> Yeah sure, only you need something to draw on first. For example a bitmap,
> and then send that bitmap back to the browser. For example:
[quoted text clipped - 20 lines]
> >
> > telbana2@yahoo.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.