Mohamad1362
پنج شنبه 24 فروردین 1391, 17:20 عصر
من از کد زیر برای تبدیل متن به عکس استفاده میکنم ، عمل تبدیل صورت میگیره ، ولی بقیه اجزا صفحه دیگه نمایش داده نمیشه ، فقط یه صفحه نمایش داده میشه که عکس توشه :
protected void Page_Load(object sender, EventArgs e)
{
Font FontName = new Font("Arial", 10);
Bitmap bitmap = new Bitmap(1, 1);
Graphics graphics = Graphics.FromImage(bitmap);
int Width = (int)graphics.MeasureString(Label1.Text, FontName).Width;
int Height = (int)graphics.MeasureString(Label1.Text, FontName).Height;
bitmap = new Bitmap(bitmap, Width, Height);
graphics = Graphics.FromImage(bitmap);
graphics.Clear(Color.White);
Rectangle displayRectangle = new Rectangle(new Point(0, 0), new Size(Width + 1, Height + 1));
graphics.DrawString(Label1.Text, FontName, Brushes.Blue, (RectangleF)displayRectangle);
Response.ContentType = "image/jpeg";
bitmap.Save(Response.OutputStream, ImageFormat.Jpeg);
bitmap.Dispose();
}
لطفا راهنمایی کنید
protected void Page_Load(object sender, EventArgs e)
{
Font FontName = new Font("Arial", 10);
Bitmap bitmap = new Bitmap(1, 1);
Graphics graphics = Graphics.FromImage(bitmap);
int Width = (int)graphics.MeasureString(Label1.Text, FontName).Width;
int Height = (int)graphics.MeasureString(Label1.Text, FontName).Height;
bitmap = new Bitmap(bitmap, Width, Height);
graphics = Graphics.FromImage(bitmap);
graphics.Clear(Color.White);
Rectangle displayRectangle = new Rectangle(new Point(0, 0), new Size(Width + 1, Height + 1));
graphics.DrawString(Label1.Text, FontName, Brushes.Blue, (RectangleF)displayRectangle);
Response.ContentType = "image/jpeg";
bitmap.Save(Response.OutputStream, ImageFormat.Jpeg);
bitmap.Dispose();
}
لطفا راهنمایی کنید