Click here to Skip to main content
15,914,016 members
Home / Discussions / C#
   

C#

 
GeneralRe: Rotate printing Pin
Luc Pattyn22-Apr-09 5:36
sitebuilderLuc Pattyn22-Apr-09 5:36 
GeneralRe: Rotate printing Pin
damichab22-Apr-09 21:01
damichab22-Apr-09 21:01 
GeneralRe: Rotate printing Pin
Luc Pattyn23-Apr-09 1:19
sitebuilderLuc Pattyn23-Apr-09 1:19 
GeneralRe: Rotate printing Pin
damichab23-Apr-09 2:06
damichab23-Apr-09 2:06 
GeneralRe: Rotate printing Pin
Luc Pattyn23-Apr-09 2:44
sitebuilderLuc Pattyn23-Apr-09 2:44 
GeneralRe: Rotate printing Pin
damichab23-Apr-09 3:31
damichab23-Apr-09 3:31 
GeneralRe: Rotate printing Pin
Luc Pattyn23-Apr-09 3:36
sitebuilderLuc Pattyn23-Apr-09 3:36 
GeneralRe: Rotate printing Pin
Luc Pattyn23-Apr-09 5:01
sitebuilderLuc Pattyn23-Apr-09 5:01 
Hi David,

here is a little RTF text scaling routine, using simple stuff only (no regex!):

private string ScaleRtf(string text, double scale) {
	log(text);
	int lastPosition=-1;
	for (; ; ) {
		int i=text.IndexOf(@"\fs", lastPosition+1);
		if (i<0) break;
		lastPosition=i;
		log("Found fs at "+i);
		int fs=0;

		for (i+=3; ; i++) {
			char c=text[i];
			int j="0123456789".IndexOf(c);
			if (j<0) break;
			fs=10*fs+j;
		}
		int newFs=ScaleUp(fs, scale);
		text=text.Substring(0, lastPosition)+@"\fs"+newFs.ToString()+text.Substring(i);
		log(text);
	}
	return text;
}

private int ScaleUp(int fs, double scale) {
	return (int)(fs*scale+0.5);
}

private void log(string s) { }


Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Avoiding unwanted divs (as in "articles needing approval") with the help of this FireFox add-in


GeneralRe: Rotate printing Pin
damichab22-Apr-09 21:15
damichab22-Apr-09 21:15 
QuestionWebBrowser.ScriptErrorsSuppressed = true and self signed certifcates Pin
jo H21-Apr-09 13:52
jo H21-Apr-09 13:52 
Questionanyone has any problem with Milestone 4 Cosmos? Pin
john231321-Apr-09 11:51
john231321-Apr-09 11:51 
AnswerRe: anyone has any problem with Milestone 4 Cosmos? Pin
Christian Graus21-Apr-09 14:04
protectorChristian Graus21-Apr-09 14:04 
Questionconvert time and minutes Pin
onetreeup21-Apr-09 8:58
onetreeup21-Apr-09 8:58 
AnswerRe: convert time and minutes Pin
PIEBALDconsult21-Apr-09 9:08
mvePIEBALDconsult21-Apr-09 9:08 
GeneralRe: convert time and minutes Pin
onetreeup21-Apr-09 9:21
onetreeup21-Apr-09 9:21 
AnswerRe: convert time and minutes Pin
Edwin Brunner21-Apr-09 9:23
Edwin Brunner21-Apr-09 9:23 
GeneralRe: convert time and minutes Pin
onetreeup21-Apr-09 9:36
onetreeup21-Apr-09 9:36 
GeneralRe: convert time and minutes Pin
Edwin Brunner21-Apr-09 9:50
Edwin Brunner21-Apr-09 9:50 
Questionhow to change property of form in an other started thread? Pin
Sajjad Izadi21-Apr-09 8:08
Sajjad Izadi21-Apr-09 8:08 
AnswerRe: how to change property of form in an other started thread? Pin
Henry Minute21-Apr-09 8:16
Henry Minute21-Apr-09 8:16 
GeneralRe: how to change property of form in an other started thread? [modified] Pin
Sajjad Izadi21-Apr-09 9:03
Sajjad Izadi21-Apr-09 9:03 
AnswerRe: how to change property of form in an other started thread? [modified] Pin
DaveyM6921-Apr-09 10:44
professionalDaveyM6921-Apr-09 10:44 
QuestionWhere to start? - Calculating the size of an object (square footage) in an image Pin
shultas21-Apr-09 8:06
shultas21-Apr-09 8:06 
AnswerRe: Where to start? - Calculating the size of an object (square footage) in an image Pin
Henry Minute21-Apr-09 8:19
Henry Minute21-Apr-09 8:19 
AnswerRe: Where to start? - Calculating the size of an object (square footage) in an image Pin
bulg21-Apr-09 12:11
bulg21-Apr-09 12:11 

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.