Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

backgrounds??

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
ok,

this probably seems really easy to you, but....

I have this really nifty program that has somthing to do with swimming pools and I want to have make the background a pretty blue wattery looking wallpaper instead of the boring default grey.

Is this possible to do?
I would appreciate if you could help me
-Thanks
 
HI

You don't tell if it's a dialog-based application or not.
Here is part of code source of the OnEraseBkgnd function I use for a Dialog Box background. In this code, I don't stretch the bitmap. Either you can stretch it to the size of the dialog or you can display bitmaps side by side to populate the dialog.
This is what I did for the Aboutbox of a sample app. I wrote to show how to get hard disk free space (see on Web Site the sample 'GetDiskData')

HTH
Thierry
EMail: Thierry.Marneffe
WebSite:
BOOL CAboutDlg::OnEraseBkgnd(CDC* pDC)
{

CDC dc;
CBitmap bm;

if ( !bmbkg.LoadBitmap( IDB_BACKGROUND))
return FALSE;

BITMAP bmbkgData;

bmbkg.GetBitmap( &bmbkgData);

// Create Compatible DC

if ( !dc.CreateCompatibleDC( pDC))
return FALSE;

// Select Bitmap

CBitmap* pOldBkgBmp = dc.SelectObject( &bmbkg);

// Fill DialogBox


pDC->StretchBlt( 0, 0,
bmbkgData.bmWidth, bmbkgData.bmHeight, &dc,
0, 0, bmbkgData.bmWidth, bmbkgData.bmHeight,
SRCCOPY);

// Clean Up

dc.SelectObject( pOldBkgBmp);

bmbkg.DeleteObject();

return TRUE; // CDialog::OnEraseBkgnd(pDC);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top