[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

simple writing problem to a picture

Patrick F

11/15/2004 4:59:00 PM

Hi, 2 questions.

1)
I created a small picture in photoshop and now im trying to add some text
upon it with my .aspx program, here is the before i added the text(picture
from photoshop) and when i added the text with .aspx (c#):
http://www.pafo.ne...

What can i do to make it look normal?

2)
How do i know if GDI+ is installed on the system and how do i use it in my
program? Any tutorials/ code examples?
1 Answer

Patrick F

11/15/2004 5:04:00 PM

0

missed afew things.
this is the code im using.
..aspx:
<%@ Page language="c#" Src="draw.aspx.cs" AutoEventWireup="true"
Inherits="testing.draw" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<script runat="server">
void Page_Load() {
Response.ContentType = "image/gif";
DrawImage();
}
</script>

codebehind:
public void DrawImage()
{
Bitmap myBitmap = new
Bitmap("C:\\Inetpub\\vhosts\\newfriendz.com\\httpdocs\\test.jpg");

Graphics myGfx = Graphics.FromImage(myBitmap);
myGfx.DrawString("testing43", new Font("Verdana", 20), new
SolidBrush(Color.Orange), 18,10);


myBitmap.Save(Response.OutputStream,ImageFormat.Gif);
myGfx.Dispose();
myBitmap.Dispose();
}


Ive tried diffrent format's on the picture file, i have tried .gif (dident
work atall), .jpg, .png and .bmp (the last 3 produces the same result)

"Patrick F" wrote:

> Hi, 2 questions.
>
> 1)
> I created a small picture in photoshop and now im trying to add some text
> upon it with my .aspx program, here is the before i added the text(picture
> from photoshop) and when i added the text with .aspx (c#):
> http://www.pafo.ne...
>
> What can i do to make it look normal?
>
> 2)
> How do i know if GDI+ is installed on the system and how do i use it in my
> program? Any tutorials/ code examples?