473,785 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 programmaticall y? 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 programmaticall y.)

TIA.
Nov 19 '05 #1
2 2638
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.a spx?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.c om> wrote in message
news:uE******** ******@TK2MSFTN GP09.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 programmaticall y? 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 programmaticall y.)

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.c om> wrote in message
news:eY******** ******@TK2MSFTN GP15.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.a spx?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.c om> wrote in message
news:uE******** ******@TK2MSFTN GP09.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 programmaticall y?
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 programmaticall y.)

TIA.


Nov 19 '05 #3

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

Similar topics

7
14256
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, then use the GetThumbnailImage method to create a second Image. This second one is the one I want to get a FileStream from, so that I can then use its Handle to use Response.WriteFile to output the thumbnail on my ASP.Net page. Any help would...
1
7227
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 "System.Drawing.Bitmap" so lately I can't convert the string to an Image.I've tryed to use an ImageConverter too,but the result is the same. Why the converter works like the Image.ToString() method?What's its goal?Anyone know how to convert an Image to a string so...
3
3637
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 application, while I am doing for web. I can only find Image from web forms control and HTML control. This may be the root cause of my problem. For read button, I converted his VB to the C#. But the compiler complains:
4
3304
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 errors. After reading the ole object from db, I saved it to C: as file1.bmp and displayed on the web. But it can not be displayed. After I manually sent the file to wordpad, it shows
4
2419
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 for me to use ? Loads of karma in it for you :) <%@ Import Namespace="System.Collections" %>
1
5415
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 web form to upload a TIFF image (scanned images) and convert it to a JPEG before I insert it into SQL Server. The file upload part works great, but I can;t convert the image. I certainly don't want to upload it the the server filesystem, convert...
5
9647
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 text. The user may "convert image to text" and copy and paste the text displayed into any word document, or send the text displayed to the recipient's email address or can download the text file as a zipped text file that will be presented to...
14
1887
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 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" BackColor="-1250856"> <DrawableRectangle LineWidth="2" X1="377" Y1="88" X2="323" Y2="130" ForeColor="-16777216" BackColor="-1" /> </DrawablePicture>
0
10783
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 inside an image, hide your complete image as text ,search for a particular image inside a directory, minimize the size of the image. However this is not a new concept, there is a concept called Steganography which enables to conceal your secret...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.