472,784 Members | 881 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,784 software developers and data experts.

Convert a text string to an image

UJ
I have need to convert a text string (with formatting) to an image. This is
so that I can resize the image to different sizes and the formatting stays
exactly the same regardless of the size. I actually want the font size to
increase/decrease as the image grows/shrinks much the way text does in a
flash object. Is there an easy way to do this programmatically? It needs to
be done behind the scenes on my web site - user enters some text - I produce
something that will displays exactly the same way on all screens regardless
of how the machine is configured. I need to be able to include things like
bolding and italics if at all possible.

(I've looked at doing a flash object but I can't seem to find some way to do
it programmatically.)

TIA.
Nov 19 '05 #1
2 2531
use the graphics library (System.Drawing) to produce the bitmap image, then
convert the bitmap to gif. you will need to write an aspx page that renders
this image (that returns an image content-type), and have the main page
refer to with an img tag

<img src="genMyGif.aspx?id=1">

where you use the id parameter to id the text to generate. google this group
for download images for more help.

-- bruce (sqlwork.com)
"UJ" <fr**@nowhere.com> wrote in message
news:uE**************@TK2MSFTNGP09.phx.gbl...
I have need to convert a text string (with formatting) to an image. This is
so that I can resize the image to different sizes and the formatting stays
exactly the same regardless of the size. I actually want the font size to
increase/decrease as the image grows/shrinks much the way text does in a
flash object. Is there an easy way to do this programmatically? It needs to
be done behind the scenes on my web site - user enters some text - I
produce something that will displays exactly the same way on all screens
regardless of how the machine is configured. I need to be able to include
things like bolding and italics if at all possible.

(I've looked at doing a flash object but I can't seem to find some way to
do it programmatically.)

TIA.

Nov 19 '05 #2
UJ
Bruce,
Thanks. But that doesn't solve my problem. It looks as if when I draw text,
it will be all of the same font/size/style. I need to be able to mix and
match styles. So that I can have a single string with bold and/or italics as
part of it. Either that or have a way to figure out how big the text
rectangle would need to be to hold one part of the text, draw the piece that
is not bolded, make another rectangle right next to it and I can add the
bolded text, then right next to that, the next text, ....

What would really make it perfect would be if I could put in formatted text
or an RichText format string in.....

Thanks.

Jeffrey.

"Bruce Barker" <br******************@safeco.com> wrote in message
news:eY**************@TK2MSFTNGP15.phx.gbl...
use the graphics library (System.Drawing) to produce the bitmap image,
then convert the bitmap to gif. you will need to write an aspx page that
renders this image (that returns an image content-type), and have the main
page refer to with an img tag

<img src="genMyGif.aspx?id=1">

where you use the id parameter to id the text to generate. google this
group for download images for more help.

-- bruce (sqlwork.com)
"UJ" <fr**@nowhere.com> wrote in message
news:uE**************@TK2MSFTNGP09.phx.gbl...
I have need to convert a text string (with formatting) to an image. This
is so that I can resize the image to different sizes and the formatting
stays exactly the same regardless of the size. I actually want the font
size to increase/decrease as the image grows/shrinks much the way text
does in a flash object. Is there an easy way to do this programmatically?
It needs to be done behind the scenes on my web site - user enters some
text - I produce something that will displays exactly the same way on all
screens regardless of how the machine is configured. I need to be able to
include things like bolding and italics if at all possible.

(I've looked at doing a flash object but I can't seem to find some way to
do it programmatically.)

TIA.


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Toby Mathews | last post by:
Hi, In an ASP.Net application I want to convert open create a FileStream object from a System.Drawing.Image - is this possible? I create an instance of an Image object using the FromFile method,...
1
by: mevar81 | last post by:
Hello to everybody.I have a problem.I used a TypeDescriptor to retrieve a TypeConverter to convert an Image to a string.The problem is that it converts the image to the string...
3
by: dale zhang | last post by:
Hi, I am trying to read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp The article author is using PictureBox for windows...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
4
by: Harry Hudini | last post by:
Hi, I need to run exactly this code in an asp.net file when someone uploads an image, but i dont know C# and im having real issues converting it. If anyone can, could you convert it to VB.net...
1
by: Daniel | last post by:
I have looked everywhere on the web for an answer to this and the only thing I can find is converting the image format when the file is present on the local filesystem. What I want to do is use a...
5
by: Socrates | last post by:
I am interested in developing an online utility that will enable users to copy and past any image (or upload any image on the internet) to the online utility, which will then convert the image to...
14
by: Joe | last post by:
this file is drawn in VB.NET and input output goes by XmlSerializer. Therefore, simple output file looks like: <?xml version="1.0" encoding="utf-8"?> <DrawablePicture...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.