Click here to Skip to main content
15,893,381 members
Home / Discussions / C#
   

C#

 
QuestionSaving text manipulated data Pin
Casper Hansen2-May-08 17:13
Casper Hansen2-May-08 17:13 
AnswerRe: Saving text manipulated data PinPopular
Christian Graus2-May-08 17:22
protectorChristian Graus2-May-08 17:22 
AnswerRe: Saving text manipulated data Pin
Casper Hansen3-May-08 2:37
Casper Hansen3-May-08 2:37 
AnswerRe: Saving text manipulated data Pin
Casper Hansen3-May-08 14:48
Casper Hansen3-May-08 14:48 
QuestionThreading events Pin
MarkB7772-May-08 16:56
MarkB7772-May-08 16:56 
AnswerRe: Threading events Pin
Christian Graus2-May-08 17:06
protectorChristian Graus2-May-08 17:06 
AnswerRe: Threading events Pin
Charith Jayasundara3-May-08 6:51
Charith Jayasundara3-May-08 6:51 
QuestionText bounds problem Pin
Richard Blythe2-May-08 10:47
Richard Blythe2-May-08 10:47 
Hey Guys,
I'm writing a section in my C# app that allows the user to add a text object that I've written. I am storing the rendered text in a bitmap so GDI+ won't be drawing text everytime the screen needs to be refreshed. Here's the problem:
I have resize handles that allow the user to expand the area to accept a bigger font size. I want the bitmap to only be the demensions of the MeasureString() method. When using the MeasureString() method, I get different returns on the width when the user expands the resize handles to the right. The text attributes haven't changed!
Here's an example that will return two different Size values:
//***********
Font font1 = new Font("Times New Roman",24.0f);
SizeF firstArea = new SizeF(100,80);
SizeF secondArea = new SizeF(180,80);

SizeF s1 = gr.MeasureString("Hello World!", font1, firstArea, StringFormat.GenericTypographic);

SizeF s2 = gr.MeasureString("Hello World!", font1, secondArea, StringFormat.GenericTypographic);
//********************

I have tried Perrie Arnold's approach of measuring strings that he proposed in his Code Project article, but doesn't change anything.
Any help on the issue would be greatly appreciated! Sigh | :sigh:

If you could rent a programmer a hour and a half for a dollar and a half, how much would he charge for 10 hours?

AnswerRe: Text bounds problem Pin
Luc Pattyn2-May-08 12:05
sitebuilderLuc Pattyn2-May-08 12:05 
GeneralRe: Text bounds problem Pin
Richard Blythe3-May-08 4:12
Richard Blythe3-May-08 4:12 
GeneralRe: Text bounds problem Pin
Luc Pattyn3-May-08 4:31
sitebuilderLuc Pattyn3-May-08 4:31 
QuestionDynamic file reading Pin
ffowler2-May-08 9:45
ffowler2-May-08 9:45 
AnswerRe: Dynamic file reading Pin
PIEBALDconsult2-May-08 10:50
mvePIEBALDconsult2-May-08 10:50 
AnswerRe: Dynamic file reading Pin
Adeel Chaudhry2-May-08 11:13
Adeel Chaudhry2-May-08 11:13 
AnswerRe: Dynamic file reading Pin
Charith Jayasundara3-May-08 6:48
Charith Jayasundara3-May-08 6:48 
QuestionHelp with reading text files Pin
False Chicken2-May-08 9:38
False Chicken2-May-08 9:38 
AnswerRe: Help with reading text files Pin
Gareth H2-May-08 10:50
Gareth H2-May-08 10:50 
AnswerRe: Help with reading text files Pin
PIEBALDconsult2-May-08 10:52
mvePIEBALDconsult2-May-08 10:52 
AnswerRe: Help with reading text files Pin
Adeel Chaudhry2-May-08 11:08
Adeel Chaudhry2-May-08 11:08 
AnswerRe: Help with reading text files Pin
Christian Graus2-May-08 12:52
protectorChristian Graus2-May-08 12:52 
Question.Net COM interop challenge Pin
Jason McBurney2-May-08 8:48
Jason McBurney2-May-08 8:48 
AnswerRe: .Net COM interop challenge Pin
PIEBALDconsult2-May-08 10:53
mvePIEBALDconsult2-May-08 10:53 
AnswerRe: .Net COM interop challenge Pin
Adeel Chaudhry2-May-08 11:11
Adeel Chaudhry2-May-08 11:11 
GeneralRe: .Net COM interop challenge Pin
Jason McBurney2-May-08 11:35
Jason McBurney2-May-08 11:35 
GeneralRe: .Net COM interop challenge Pin
Adeel Chaudhry3-May-08 0:22
Adeel Chaudhry3-May-08 0:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.