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.Pixels.
/// </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">The 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="orientation">ReadFromLHSPage or ReadFromRHSPage</param>
public void DrawVertText(String strText, Font font, Brush brush, float
fX, float fY, VTextROrientation orientation)
{
StringFormat strf = new
StringFormat(StringFormatFlags.DirectionVertical);
//
// No translation
//
if( orientation == VTextROrientation.ReadFromLHSPage )
{
graph.DrawString(strText, font, brush, fX, fY, strf);
}
else if( orientation == VTextROrientation.ReadFromRHSPage )
{
//
// Get size of drawn text in Pixels
//
SizeF sizeText = graph.MeasureString(strText, font, 2000, strf);
int width = Convert.ToInt32(sizeText.Width);
int height = Convert.ToInt32(sizeText.Height);
//
// 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.MakeTransparent(Color.White);
Graphics grfBmp = Graphics.FromImage( bmp );
grfBmp.DrawString(strText, font, brush, 0, 0, strf);
bmp.RotateFlip(RotateFlipType.Rotate180FlipNone);
//
// Draw the bitmap into the page.
//
Rectangle rect = new Rectangle(Convert.ToInt32(fX),
Convert.ToInt32(fY),
Convert.ToInt32(sizeText.Width),
Convert.ToInt32(sizeText.Height) );
graph.DrawImage(bmp, rect, 0, 0, width , height,
GraphicsUnit.Pixel);
}
}
"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.public.dotnet.framework.drawing
Cor