473,386 Members | 1,973 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,386 software developers and data experts.

LinkLabel to Bitmap Problem

I want to save the text "Microsoft Visual Studio" as Bitmap in one line, but following lines of code is displaying it two line: 'Microsoft Visual' in a line and 'Studio' in another line.

Expand|Select|Wrap|Line Numbers
  1. using System.Data;
  2. using System.Drawing;
  3. using System.Text;
  4. using System.Windows.Forms;
  5.  
  6. namespace LinkLabelBitmap
  7. {
  8.     public partial class Form1 : Form
  9.     {
  10.         public Form1()
  11.         {
  12.             InitializeComponent();
  13.         }
  14.  
  15.         public void ConvertLinkLabelToBitmap()
  16.         {
  17.             LinkLabel ll = new LinkLabel();
  18.             ll.Text = "Microsoft Visual Studio";
  19.             ll.LinkArea = new LinkArea(10, ll.Text.Length);
  20.  
  21.             //Label l = new Label();
  22.             //l.Text = "Microsoft Visual Studio";
  23.  
  24.             Bitmap bmp = new Bitmap(400, 50);
  25.             ll.DrawToBitmap(bmp, ll.Bounds);
  26.             bmp.Save(@"c:\chk.jpg");
  27.             bmp.Dispose();
  28.         }
  29.  
  30.         private void Form1_Load(object sender, EventArgs e)
  31.         {
  32.             ConvertLinkLabelToBitmap();
  33.             this.Close();
  34.         }
  35.     }
  36. }
How can I save the whole text in a single line Bitmap?
Nov 26 '08 #1
2 1080
anijos
52
Hi,

Try

11.DrawToBitmap(bmp, New Rectangle(0, 0, 400, 50));

Thanks
AniJos
Nov 26 '08 #2
Yes, I used
ll.Bounds = new Rectangle(ll.Bounds.Left, ll.Bounds.Top, ll.PreferredWidth, e.Bounds.Height);
and it solves.....
Anyway thanx
Nov 26 '08 #3

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

Similar topics

0
by: tota | last post by:
i'm using windowsApplication to connect to DB made by SQL i need to Display the Data of the first table in the DB as links when click it it openes a table and i navigte between them using buttons...
1
by: gabe | last post by:
I am looking for a way to mimic some of the functionality of a web page without writing html (or I am looking to someone to point out something really obvious that I am over looking) Currently I...
1
by: Joshua Ellul | last post by:
Hi There, I'm trying to create a link label dynmically. The problems I'm having is the following: 1. The LinkLabel is created without the underline 2. The click event is not being raised... ...
3
by: vince | last post by:
Hello, I have a ListBox filled with many lines of simply text I want to make few lines be a LinkLabel How can I do this Thanks
1
by: Marcus Kwok | last post by:
I am having problems getting my LinkLabel hyperlink to work properly. Every time I click on it, I get the following exception: System.ComponentModel.Win32Exception: The requested lookup key was...
2
by: Terrance | last post by:
Can someone please help with a problem that I'm having? I'm trying to create a linklabel in VB.NET 2003 at runtime when a user clicks a button. The app looks in a path for .doc and .pdf files and...
4
by: David Veeneman | last post by:
I'm creating a UserControl that uses a LinkLabel. For reasons that I won't bore everyone with, I don't want the LinkLable to show the default hand cursor when the mouse enters the control. Should...
3
by: bsturg21 | last post by:
Hello, I have a windows form that has a series of linklabels on it, and I need to have each linklabel, when clicked, open a separate windows form that has a single paramter passed into it. The...
2
by: prokopis | last post by:
am using c# for windows applications. am using dynamic linklayer array to print some labels in the form.i get some data from the database i add them in the linklabel array and i print it on the...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.