home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / msdos / programm / 8047 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  1.5 KB

  1. Xref: sparky comp.os.msdos.programmer:8047 comp.os.ms-windows.programmer.misc:989
  2. Newsgroups: comp.os.msdos.programmer,comp.os.ms-windows.programmer.misc
  3. Path: sparky!uunet!mcsun!sunic!ugle.unit.no!lise.unit.no!geirt
  4. From: geirt@Lise.Unit.NO (Geir Torheim)
  5. Subject: Drawing in a scrolled TWindow
  6. Message-ID: <1992Jul24.082150.6755@ugle.unit.no>
  7. Keywords: Windows, scrolling, drawing
  8. Sender: news@ugle.unit.no (NetNews Administrator)
  9. Organization: Norwegian Institute of Technology
  10. Date: Fri, 24 Jul 92 08:21:50 GMT
  11. Lines: 29
  12.  
  13. I'm using Windows 3.1 & BC++ 3.0 with application frameworks.
  14.  
  15. I have inherited from TWindow and made a window containing a TScroller, which
  16. scrolls just fine. 
  17.  
  18. The problem occurs when I want to draw in the scrolled
  19. window; The TScroller adjusts the origin of the viewport but
  20. GetDC returns a HDC with the origin set to (0,0)!. 
  21.  
  22. According to the Windows doc I can create a private DC and then use this for all
  23. drawing operations in this window. A private DC will (I think) contain the
  24. correct origin, and I can use functions like DPtoLP() to do the job.
  25.  
  26. However, private DC's are 'expensive in terms of system resources.' 
  27.  
  28. Anybody who knows HOW expensive they are ??
  29. Will the private DC also be drawn from this pool of 5 DCs ?
  30. Is it a good idea to use a private DC for this, or should I save the
  31. new origin 'manually'?. That's what I'm doing now. I do this in the
  32. Paint() function of the window. Dirty perhaps, but it works...
  33.  
  34.  
  35.  
  36. Thanks for listening !
  37.  
  38. -geir
  39.  
  40. -- 
  41. Geir Torheim                             email: geirt@lise.unit.no
  42.