Reply
asp.net dynamic image [add two images]
Old 01-09-2008, 04:22 PM asp.net dynamic image [add two images]
Skilled Talker

Posts: 77
I want to have custom smilies that I can use like a regular image.
(head:15x10,mouth:15x4,together:15x14--they will all be separate images)
you choose eyes and mouth(1-6)
url.com/p.aspx?face=1&mouth=4



Do you know how, or know a any tutorials?

Last edited by Skeddles : 01-09-2008 at 04:43 PM.
Skeddles is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 01-09-2008, 06:45 PM Re: asp.net dynamic image [add two images]
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,025
Name: Forrest Croce
Location: Seattle, WA
I'm really not sure what you're trying to do. Still, here's some C# code that ought to get you pretty close:

Bitmap b = new Bitmap(640, 480);
b.SetPixel(100, 100, Color.FromArgb(128, 128, 128));
b.Save("file.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
Response.Write("<img src='file.jpg' />");

If you have the component images already saved, use those ... the Get and Set -Pixel methods are slow. To do that, you'll need to use the Graphics object, and tell it to draw to an image. This is how double buffering works.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 01-25-2008, 12:25 AM Re: asp.net dynamic image [add two images]
Skilled Talker

Posts: 77
Code:
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<script language="VB" runat="server">

Sub Page_Load(sender As Object, e As EventArgs)
Dim objBitmap As New Bitmap(15,14)
Dim objGraphic as Graphics = Graphics.FromImage(objBitmap)



Response.ContentType = "image/gif"
objBitmap.Save (Response.OutputStream, ImageFormat.Gif)
End Sub

Response.Write("")
</script>
Honestly, I have no clue what i'm doing.

I just want to make an image thats 15x14px, draw 1.gif at (1,1), then draw a.gif at (1,11).


then make it possible to specify the images in the url, like: url.com/dynamicimage.aspx?firstimage=2.gif&secondimage=d.g if
Skeddles is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to asp.net dynamic image [add two images]
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11944 seconds with 13 queries