|
Hello,
I need to add a string on top / on bottom of a few drown GDI objects on printing. So far i override the OnPrint function.The problem i am facing is to decide where the text should be added in the CDC (i cant find the coordinates needed for TextOut)
I tried with CDC::GetBoundsRect(&dcRect, 0); but in dcRect i get nothing but zeros and the function returns 1. I think its returning DCB_RESET but i am not sure.
I tried with GetCurrentBitmap and GetBitmapDimension but still i get CSize variable with nothing but zeros.
All help is welcome
|
|
|
|
|
The best thing i found is in the Microsoft Superpad example on the next link
Superpad
You can see how to put Header / Footer in it.
|
|
|
|
|
Using API In MFC OnDraw
TextOut(pDC->GetSafeHdc(),1, 20, "HELLO HELLO", 11);
I am not sure if that will print alligned properly.
|
|
|
|
|
My problem is finding the right coordinates for the TextOut function but after a talk with my Team manager we decided its better to be done as a header / footer.
Before that i just wanted to get the BoundRectangle with the hopes that it will be describing only the part in the page where the elements will be drown not the whole page itself.
I was wondering if there is a way to get out of the CDC member information about the position of the elements or something like that but i couldn't find any.
|
|
|
|