<dirk.kl...@t-online.de> wrote in message news:87rko1$qos$1...@news04.btx.dtag.de...
Hallo newsgroup,
I want to learn how to draw and paint in a view.
I looked up in the help of the Developer Studio, but I
found only things that I didn't understand.
e.g. : I wanted to draw a line. So I searched for the
appropriate function. I found the function 'LineTo'.
But I didn't understand the parameter which is of
the type 'handle of a device context'. In the 'OnDraw'
function is only given a device context but not a handle
of it.
So does anybody know where to find a good introduction/tutorial/....
to learn the basics of drawing and painting in an MFC view?
thanks,
Timo
IMO, of course. There may be other books that others recommend.
John
Sent via Deja.com http://www.deja.com/
Before you buy.
With best wishes,
Igor Tandetnik
<dirk.kl...@t-online.de> wrote in message
news:87rko1$qos$1...@news04.btx.dtag.de...
CPaintDC dc(this);
The dc variable is of type CDC (actually a subclass of CDC), and you
use it by doing
dc.LineTo(...);
dc.MoveTo(...);
dc.TextOut(...);
etc.
If you are doing drawing outside the OnPaint handler, which is
occasionally done, you can use GetDC/ReleaseDC to get a temporary DC,
or just use
CClientDC dc(CWnd *);
where the CWnd * references a window in which you are drawing, which
gets you a DC for the client area of that window.
joe
On Thu, 10 Feb 2000 19:31:15 +0100, dirk.kl...@t-online.de wrote:
>Thank you for the 'LineTo' help.
>
>But I didn't understand yet the difference between a device context and a
>device handle.
>
>I've also two other questions:
>1) I thought that a device context have saved the properties of the output
>device.
>But why can you call the member-function 'MoveTo'. How can you move a
>device context?
>2) If I want to draw a letter which is close to the next letter (but not
>in one line) you can only see a part
> of it, 'cause there's always a "white rectangle" around the letters.
>How can I turn this property off?
>
>
>Timo
>
>
>P.S.: The others said that Scribble is a good tutorial to learn drawing
>and painting with MFC, but in my oppinion it is not,
>because it just shows how to let the user draw with the mouse. You don't
>learn anything about drawing lines, Bitmaps, fonts, ...... .
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm