What is a graphic context? (iOS)
"it seems like it is an object or so that take care of the correct drawing whether it is for printing, device, pdf and so on."
Exactly correct.
You simply write routines that "really" do some drawing (but it could be to anywhere, to any type of thing or device). You don't have to worry about ANYTHING other than drawing in the abstract ... lines, circles, typography, colours and other such nonsense.
-(void)happyDrawing
-(void)sadDrawing
-(void)fancyDrawing
Then -- amazingly -- you can use those anywhere.
-(void)makeSomeFiles
{
.. set up a context for making files
.. happyDrawing
}
-(void)makeATruGrayScaleBitmap
{
.. set up a context for making a gray bitmap
.. happyDrawing
}
-(void)drawRect
{
.. drawing on your Lisa screen
.. happyDrawing
}
-(void)drawRect
{
.. drawing on your iPad screen
.. happyDrawing
}
-(void)printAPage
{
.. set up a context for printing
.. happyDrawing
}
I hope it helps!