Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!sdd.hp.com!hp-pcd!hpcvlx!bturner From: bturner@hpcvlx.cv.hp.com (Bill Turner) Newsgroups: comp.windows.ms Subject: Re: Create-In-CompatibleDC? Message-ID: <106580088@hpcvlx.cv.hp.com> Date: 9 May 90 17:01:30 GMT References: <118500015@uxa.cso.uiuc.edu> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 22 > I have a probably trivial question. I need to do the following: > > 3) Then, on a timer event, I want to create a compatibleDC, select a > compatible bitmap into it, do some drawing, bitblt to the real DC > and get out. > >What I find is that when I call CreateCompatibleDC(hDC), the memory device >context does not have any of the mapping mode information at all! The memory >device context returns essentially a DC with the default settings! The problem is your assumption about what a compatible DC is. It is compatible to the physical characteristics of a device specified by an existing DC (such as pixels per inch, aspect ratio, number of colors, etc.), but not to the currently selected attributes (which are changeable). What you can do is, after creating the compatible DC, query the existing DC and use those attributes to set the compatible DC state (or if the attributes are constant, just set them). Any time you create a DC, it comes up with the default attributes (documented). --Bill Turner (bturner@hp-pcd.hp.com) HP Interface Technology Operation