Click here to Skip to main content
15,890,845 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralNeed some advice - header file issues Pin
Yguy26-Apr-05 14:09
Yguy26-Apr-05 14:09 
GeneralRe: Need some advice - header file issues Pin
PJ Arends26-Apr-05 15:23
professionalPJ Arends26-Apr-05 15:23 
GeneralI figured it out... Pin
Yguy26-Apr-05 15:30
Yguy26-Apr-05 15:30 
GeneralRe: I figured it out... Pin
Rick York27-Apr-05 6:14
mveRick York27-Apr-05 6:14 
GeneralIE Form Filler Pin
Krazyman26-Apr-05 11:59
Krazyman26-Apr-05 11:59 
GeneralRe: IE Form Filler Pin
Michael Dunn26-Apr-05 12:16
sitebuilderMichael Dunn26-Apr-05 12:16 
GeneralImage Printing Pin
Member 94915926-Apr-05 11:54
Member 94915926-Apr-05 11:54 
GeneralRe: Image Printing Pin
Peter Ritchie26-Apr-05 17:48
Peter Ritchie26-Apr-05 17:48 
In your CView-derived class's OnDraw:
CBitmap bmp;
if (bmp.LoadBitmap(IDB_BITMAP1))
{
   // Get the size of the bitmap
   BITMAP bmpInfo;
   bmp.GetBitmap(&bmpInfo);

   // Create an in-memory DC compatible with the
   // display DC we're using to paint
   CDC dcMemory;
   dcMemory.CreateCompatibleDC(pDC);

   // Select the bitmap into the in-memory DC
   CBitmap* pOldBitmap = dcMemory.SelectObject(&bmp);

   // Find a centerpoint for the bitmap in the client area
   CRect rect;
   GetClientRect(&rect);
   int nX = rect.left + (rect.Width() - bmpInfo.bmWidth) / 2;
   int nY = rect.top + (rect.Height() - bmpInfo.bmHeight) / 2;

   // Copy the bits from the in-memory DC into the on-
   // screen DC to actually do the painting. Use the centerpoint
   // we computed for the target offset.
   pDC->BitBlt(nX, nY, bmpInfo.bmWidth, bmpInfo.bmHeight, &dcMemory,
      0, 0, SRCCOPY);

   dcMemory.SelectObject(pOldBitmap);
}


PeterRitchie.com
Generalsystem files Pin
trupgmtuf26-Apr-05 11:46
susstrupgmtuf26-Apr-05 11:46 
GeneralRe: system files Pin
Peter Ritchie26-Apr-05 17:51
Peter Ritchie26-Apr-05 17:51 
QuestionBrowseFolders Dialog on Win2k/IE5? Pin
Ingmar326-Apr-05 11:07
Ingmar326-Apr-05 11:07 
AnswerRe: BrowseFolders Dialog on Win2k/IE5? Pin
Peter Ritchie26-Apr-05 17:20
Peter Ritchie26-Apr-05 17:20 
GeneralRe: BrowseFolders Dialog on Win2k/IE5? Pin
Ingmar326-Apr-05 21:18
Ingmar326-Apr-05 21:18 
GeneralRe: BrowseFolders Dialog on Win2k/IE5? Pin
Peter Ritchie29-Apr-05 5:26
Peter Ritchie29-Apr-05 5:26 
GeneralRe: BrowseFolders Dialog on Win2k/IE5? Pin
Ingmar313-May-05 1:40
Ingmar313-May-05 1:40 
Generaldelete this questions Pin
Steve Messer26-Apr-05 10:42
Steve Messer26-Apr-05 10:42 
GeneralRe: delete this questions Pin
PJ Arends26-Apr-05 11:17
professionalPJ Arends26-Apr-05 11:17 
GeneralRe: delete this questions Pin
Anonymous26-Apr-05 11:27
Anonymous26-Apr-05 11:27 
GeneralRe: delete this questions Pin
Steve Messer26-Apr-05 12:02
Steve Messer26-Apr-05 12:02 
GeneralRe: delete this questions Pin
PJ Arends26-Apr-05 12:16
professionalPJ Arends26-Apr-05 12:16 
GeneralRe: delete this questions Pin
Steve Messer26-Apr-05 12:28
Steve Messer26-Apr-05 12:28 
GeneralRe: delete this questions Pin
PJ Arends26-Apr-05 12:54
professionalPJ Arends26-Apr-05 12:54 
GeneralRe: delete this questions Pin
Maximilien26-Apr-05 12:10
Maximilien26-Apr-05 12:10 
GeneralRe: delete this questions Pin
Brian R26-Apr-05 12:45
Brian R26-Apr-05 12:45 
GeneralRe: delete this questions Pin
PJ Arends26-Apr-05 13:21
professionalPJ Arends26-Apr-05 13:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.