home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / mswindo / programm / misc / 995 < prev    next >
Encoding:
Internet Message Format  |  1992-07-24  |  1.4 KB

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