🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #459

Drawing in a scrolled TWindow

#459
From: Geir Torheim
Date: Fri, 24 Jul 1992 08:21
29 lines
1520 bytes
I'm using Windows 3.1 & BC++ 3.0 with application frameworks.

I have inherited from TWindow and made a window containing a TScroller, which
scrolls just fine. 

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...



Thanks for listening !

-geir

-- 
Geir Torheim                             email: geirt@lise.unit.no
Technical Details
Message-ID: <1992Jul24.082150.6755@ugle.unit.no>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!ugle.unit.no!lise.unit.no!geirt

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer,comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!ugle.unit.no!lise.unit.no!geirt
From: geirt@Lise.Unit.NO (Geir Torheim)
Subject: Drawing in a scrolled TWindow
Message-ID: <1992Jul24.082150.6755@ugle.unit.no>
Keywords: Windows, scrolling, drawing
Sender: news@ugle.unit.no (NetNews Administrator)
Organization: Norwegian Institute of Technology
Date: Fri, 24 Jul 92 08:21:50 GMT
Lines: 29