Forum Xamarin.iOS

Printing rotated text to a printer

NeilTurpNeilTurp GBMember ✭✭
edited June 2018 in Xamarin.iOS

I have an app that displays data in a spreadsheet format with each column labelled vertically. Works well. However, I now need to produce a printed output. It needs to be more than just a screen dump. So far I create an Image of the same size as the screen then draw all the relevant data onto it. However when I try to write the column headers vertically, they all come out written in horizontal text. The code I am using is a function inside a class:

void PaintView( CGRect rect, NSFont ft)
{
    NSStringAttributes attr = new NSStringAttributes(){Font = ft, ForegroundColor = NSColor.Black};
    FrameRotation = 90;

    ((NSString)HeaderName).DrawInRect(rect, attr);
}

called:

rc.PaintView(rect, attr);

What am I missing?

Neil

Answers

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    I'm having trouble parsing your code enough to understand your specific issue.

    In general, you can rotate your context with something like RotateCTM.

Sign In or Register to comment.