473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How do you make a bitmap from a string?

I would l like to make a System.Drawing.bitmap by drawing a rectangle with a string inside the rectangle, so how do you convert a string into a bitmap?

C# or VB examples are ok if anyone has any :)
Jun 4 '07 #1
3 1260
mwalts
38
I would l like to make a System.Drawing.bitmap by drawing a rectangle with a string inside the rectangle, so how do you convert a string into a bitmap?

C# or VB examples are ok if anyone has any :)
MSDN is our friend :)

and so are earlier posts in this forum, check
http://www.thescripts.com/forum/thread224735.html

and
look into MSDN for the System.Drawing.Graphics and System.Drawing.Bitmap methods and members.

Anyway, it seems that once you have created a bitmap, you can create a fraphics object from it, alter that graphics object, and if you haven't made your bitmap reference point somewhere it it will now contain the updated bitmap

have fun,

-mwalts
Jun 4 '07 #2
Plater
7,872 Expert 4TB
Create a bitmap at the size you want.
Create a Graphics object for it.
use the .DrawString() function in graphics to draw a string on your bitmap

vola!
Jun 5 '07 #3
ah cool it works, it's actually supringsly fast on .net CF :)
Jun 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sharon | last post by:
I encountered a strange behavior when doing ‘new Bitmap’: The following code works fine and the given bitmap file is shown on the PictureBox (the m_DrawArea) in the correct bitmap sizes: ...
6
by: Lespaul36 | last post by:
From what I have read, there isn't really a converter to icon format..it becomes a png file. I tried: 1: Dim bmp As Bitmap = CType(Bitmap.FromFile("C:\myfolder\file.bmp"), Bitmap) 2: ...
8
by: Nathan Sokalski | last post by:
I am trying to write code to rotate a graphic that I have. Here is the code I am currently using: Dim frogbitmap As New Bitmap(Drawing.Image.FromFile(Server.MapPath("images/frog.gif"))) Dim...
7
by: Nathan Sokalski | last post by:
I am having a problem saving an image with the same name it originally had. I have two similar versions of my code, one in which I close the FileStream used to open the original image before saving,...
1
by: Smokey Grindel | last post by:
I have a bitmap object I want to return as a JPEG image with a compression set at 90% and progressive passes enabled, how can I do this in .NET 2.0? Progressive passes are not necessary but the...
2
by: =?Utf-8?B?UHJ6ZW1v?= | last post by:
Hi, I would like to have a web service method sending a bitmap image. But code like do not work: <WebMethod()_ Public Function GetBitmap() As Drawing.Bitmap Dim a As New...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.