473,796 Members | 2,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Vertical and Angled Text

I write software that needs to draw simple engineering drawings for factory
workers to read.

A standard for drawings is to be able to read the text from the bottom right
corner.
The GDI defaults vertical text to be readable from the left side of the page
(upside down). It seems from the news group that many people are having
problems with this.

Additionally we have the need to be able to draw text along an angled line,
we have been able to do this for the last 30 years on Plotters, Laser
printers, Postscript printers, Non-Microsoft Graphic screens, Printer
plotters and our own bit map printer support.

I think it is about time we could draw text directly at any angle from 0 to
360 degress it in the Windows GDI.

Is it possible to do this now and if not how about making it possible ?
Nov 22 '05 #1
4 2674
Philip,

Did you know that this is a typical question for the newsgroup

microsoft.publi c.dotnet.framew ork.drawing

Cor
Nov 22 '05 #2
Thanks Cor but I could only find one item in there about this, it was also in
the managed section and had to do with rounding the inches position. I had
already looked through the managed news group as well, most were more related
to controls or using bit maps to get around the problem. This is a fairly
fundemental issue of what can be drawn to a device, it should be supported
directly in the GDI and I am surprised that it is not, when non-Microsoft
inplementors of printers etc.. include this as standard fair. I can get
around it by drawing into a bitmap or metadata and including that in my
drawing but this should not be needed. It should be possible to draw such
basic stuff from the GDI and I am surprised that the GDI does not support
this directly. I was hopeing it was there or to prompt MS to add it.

"Cor Ligthert" wrote:
Philip,

Did you know that this is a typical question for the newsgroup

microsoft.publi c.dotnet.framew ork.drawing

Cor

Nov 22 '05 #3
Philip,

It is not my stuff however I have seen questions like yours so often
(although to screen forever). There is a lot of stuff about GDI on MSDN but
mostly hard to find, mabye this link you can use as a start.

http://msdn.microsoft.com/library/de...us/GDIPlus.asp

Cor
Thanks Cor but I could only find one item in there about this, it was also in the managed section and had to do with rounding the inches position. I had
already looked through the managed news group as well, most were more related to controls or using bit maps to get around the problem. This is a fairly
fundemental issue of what can be drawn to a device, it should be supported
directly in the GDI and I am surprised that it is not, when non-Microsoft
inplementors of printers etc.. include this as standard fair. I can get
around it by drawing into a bitmap or metadata and including that in my
drawing but this should not be needed. It should be possible to draw such
basic stuff from the GDI and I am surprised that the GDI does not support
this directly. I was hopeing it was there or to prompt MS to add it.

"Cor Ligthert" wrote:
Philip,

Did you know that this is a typical question for the newsgroup

microsoft.publi c.dotnet.framew ork.drawing

Cor

Nov 22 '05 #4
I have done this to work around it in C# GDI+ but I should not have to do
this.
(It ignores Graphics scaling and it makes little bitmaps for the text)

/// <summary>
/// Assumes the graphics device is operating in GraphicsUnit.Pi xels.
/// </summary>
/// <param name="strText"> The text string to write.</param>
/// <param name="font">The font to be used for this text.</param>
/// <param name="brush">Th e brush to be used for this text.</param>
/// <param name="fX">The X coordinate in pixels.</param>
/// <param name="fY">The Y coordinate in pixels.</param>
/// <param name="orientati on">ReadFromLHS Page or ReadFromRHSPage </param>
public void DrawVertText(St ring strText, Font font, Brush brush, float
fX, float fY, VTextROrientati on orientation)
{
StringFormat strf = new
StringFormat(St ringFormatFlags .DirectionVerti cal);

//
// No translation
//
if( orientation == VTextROrientati on.ReadFromLHSP age )
{
graph.DrawStrin g(strText, font, brush, fX, fY, strf);
}
else if( orientation == VTextROrientati on.ReadFromRHSP age )
{
//
// Get size of drawn text in Pixels
//
SizeF sizeText = graph.MeasureSt ring(strText, font, 2000, strf);
int width = Convert.ToInt32 (sizeText.Width );
int height = Convert.ToInt32 (sizeText.Heigh t);

//
// Make a bitmap make it transparent (uses white as transparency
color !)
// draw the string in it
// then flip that image.
//
Bitmap bmp = new Bitmap(width , height);
bmp.MakeTranspa rent(Color.Whit e);
Graphics grfBmp = Graphics.FromIm age( bmp );
grfBmp.DrawStri ng(strText, font, brush, 0, 0, strf);
bmp.RotateFlip( RotateFlipType. Rotate180FlipNo ne);

//
// Draw the bitmap into the page.
//
Rectangle rect = new Rectangle(Conve rt.ToInt32(fX),
Convert.ToInt32 (fY),
Convert.ToInt32 (sizeText.Width ),
Convert.ToInt32 (sizeText.Heigh t) );
graph.DrawImage (bmp, rect, 0, 0, width , height,
GraphicsUnit.Pi xel);
}
}
"Cor Ligthert" wrote:
Philip,

It is not my stuff however I have seen questions like yours so often
(although to screen forever). There is a lot of stuff about GDI on MSDN but
mostly hard to find, mabye this link you can use as a start.

http://msdn.microsoft.com/library/de...us/GDIPlus.asp

Cor
Thanks Cor but I could only find one item in there about this, it was also

in
the managed section and had to do with rounding the inches position. I had
already looked through the managed news group as well, most were more

related
to controls or using bit maps to get around the problem. This is a fairly
fundemental issue of what can be drawn to a device, it should be supported
directly in the GDI and I am surprised that it is not, when non-Microsoft
inplementors of printers etc.. include this as standard fair. I can get
around it by drawing into a bitmap or metadata and including that in my
drawing but this should not be needed. It should be possible to draw such
basic stuff from the GDI and I am surprised that the GDI does not support
this directly. I was hopeing it was there or to prompt MS to add it.

"Cor Ligthert" wrote:
Philip,

Did you know that this is a typical question for the newsgroup

microsoft.publi c.dotnet.framew ork.drawing

Cor


Nov 22 '05 #5

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

Similar topics

3
12439
by: kAldam | last post by:
I am currently using IE 6.0 and 5.5 and the scenario is the following. I have a span that contains text, and the span is beign contained by a table cell (this is the way thing need to be in my application). I have an issue when the span has a heigth less than 18px (meaning height of the span, there is only one line of text and the height of the text is less than 18). The issue is that I start getting a padding, I add a color background to...
1
7902
by: Kenneth | last post by:
Okay, I've been scouring Google for hours looking for a solution to this problem, but as of yet I can't find one. XHTML Transitional seems to specify that I can no longer set a table's height to 100% and vertically center content inside of it. Therefore, I'm seeking a way, preferably in CSS to vertically center a site. Here's more of a visual to what I have: /********************************
4
526
by: Philip K | last post by:
I write software that needs to draw simple engineering drawings for factory workers to read. A standard for drawings is to be able to read the text from the bottom right corner. The GDI defaults vertical text to be readable from the left side of the page (upside down). It seems from the news group that many people are having problems with this. Additionally we have the need to be able to draw text along an angled line,
2
12143
by: Eric Lindsay | last post by:
If I want to have the middle of an image vertically aligned with the middle of a heading (or several lines of heading), is there some particular way people would recommend? vertical-align: center looked made for that. The effect I want is img heading img heading img heading or heading
5
4826
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up doing this demo with tables. The main problems are the vertical centering of the info area, and of the text inside the squares.
3
4423
by: acunnon | last post by:
I am trying to put together an login page my problem is getting the three items aligned to the middle verticaly without specifing a height to anything on the page. CSS html{ height:100%; min-height:100%; } body{ vertical-align:middle;
2
15569
by: esteuart | last post by:
I need to get the right combination for a div to clip any text inside and allow vertical alignment. I only have this problem in FireFox. I have 3 divs nested within each other. The outer div has display of table, the first inner div has display of table-cell and the inner-most div has the text. The outer div has a set width and height. So here's the problem: Without the inner divs having a width and height set, the overflow:hidden doesn't...
8
3555
by: ayamopamo | last post by:
Hi- I am trying to center a web page. It seems like this should be very simple to do, but apparently it isn't my day. I have successfully centered the background by calling it in the css body tag: body { font-family: Trebuchet MS, Arial; cursor : default; background:#000000 url("Images/long-template.jpg"); background-repeat:no-repeat; background-position: center; background-attachment:scroll; height: 1228px;
40
5506
by: maya | last post by:
hi, how do I get text to vertical-align inside a div? http://www.mayacove.com/misc/home.html vertical-align should work, according to this: http://htmlhelp.com/reference/css/text/vertical-align.html
1
1148
by: Ken Fine | last post by:
Hi, hoping someone can help out with what's a simple question. I am using the ASP.NET VE map control here on a site, which I am still developing. I'm putting picture icons on a map: http://kenfine.posterous.com/uw-map-overhead I am using the ASP.NET VE server control in 3d mode, as you see. I can specify an overhead view that is accurate using the following declaration.
0
9531
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10237
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10018
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...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
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
6795
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
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4120
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
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.