home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!malgudi.oar.net!uoft02.utoledo.edu!desire.wright.edu!rocker
- Newsgroups: comp.os.ms-windows.programmer.misc
- Subject: Re: Drawing in a scrolled TWindow
- Message-ID: <1992Jul24.075157.3076@desire.wright.edu>
- From: rocker@desire.wright.edu
- Date: 24 Jul 92 07:51:57 EST
- References: <1992Jul24.082150.6755@ugle.unit.no>
- Organization: Wright State University
- Lines: 22
-
- geirt@Lise.Unit.NO (Geir Torheim) writes:
- > The problem occurs when I want to draw in the scrolled
- > window; The TScroller adjusts the origin of the viewport but
- > GetDC returns a HDC with the origin set to (0,0)!.
- >
- > According to the Windows doc I can create a private DC and then use this for all
- > drawing operations in this window. A private DC will (I think) contain the
- > correct origin, and I can use functions like DPtoLP() to do the job.
- >
- > However, private DC's are 'expensive in terms of system resources.'
- >
- > Anybody who knows HOW expensive they are ??
- > Will the private DC also be drawn from this pool of 5 DCs ?
- > Is it a good idea to use a private DC for this, or should I save the
- > new origin 'manually'?. That's what I'm doing now. I do this in the
- > Paint() function of the window. Dirty perhaps, but it works...
- >
-
- Just approach it from a level up, ie wmPaint instead of paint. This
- way you are still using only one DC, gotten by GetDc yourself.
-
- rock hard
-