N
needin4mation
Hi, using this code I pieced together from others:
<%@ Page language="c#" Debug="true" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<script language="C#" runat="server">
Bitmap bkGroundImg = null;
Bitmap userImg = null;
Graphics bkImgGraphics = null;
Graphics userImgGraphics = null;
void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "image/jpeg";
string url = Request.QueryString["url"];
string trans = Request.QueryString["trans"];
trans ="0";
// Response.Write("url: "+url);
// Response.Write("<userImgr>trans:
"+(float)DouuserImgle.Parse(trans));
WebClient client = new WebClient();
Stream stream = client.OpenRead(trans);
userImg = new Bitmap(stream);
userImg = new Bitmap(userImg, 100, 100);
stream.Close();
bkGroundImg = new Bitmap(100 + 10, 100 + 10);
bkImgGraphics = Graphics.FromImage(bkGroundImg);
userImgGraphics = Graphics.FromImage(userImg);
bkImgGraphics.DrawImage(userImg, 2, 2);
bkGroundImg.Save(Response.OutputStream, ImageFormat.Jpeg);
}
</script>
I can get this to work fine. The page produces the image.
I want to use the output of the page, however, to populate an Image
Control on another page. I am trying this:
Image1.ImageUrl = "GetImage.aspx";
but it doesn't return anything to the calling page. No errors, just no
image. What am I doing wrong?Thank you for any help.
<%@ Page language="c#" Debug="true" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<script language="C#" runat="server">
Bitmap bkGroundImg = null;
Bitmap userImg = null;
Graphics bkImgGraphics = null;
Graphics userImgGraphics = null;
void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "image/jpeg";
string url = Request.QueryString["url"];
string trans = Request.QueryString["trans"];
trans ="0";
// Response.Write("url: "+url);
// Response.Write("<userImgr>trans:
"+(float)DouuserImgle.Parse(trans));
WebClient client = new WebClient();
Stream stream = client.OpenRead(trans);
userImg = new Bitmap(stream);
userImg = new Bitmap(userImg, 100, 100);
stream.Close();
bkGroundImg = new Bitmap(100 + 10, 100 + 10);
bkImgGraphics = Graphics.FromImage(bkGroundImg);
userImgGraphics = Graphics.FromImage(userImg);
bkImgGraphics.DrawImage(userImg, 2, 2);
bkGroundImg.Save(Response.OutputStream, ImageFormat.Jpeg);
}
</script>
I can get this to work fine. The page produces the image.
I want to use the output of the page, however, to populate an Image
Control on another page. I am trying this:
Image1.ImageUrl = "GetImage.aspx";
but it doesn't return anything to the calling page. No errors, just no
image. What am I doing wrong?Thank you for any help.