Click here to Skip to main content
15,915,869 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSetting a bmp as a window background Pin
jkirkerx10-Oct-11 13:40
professionaljkirkerx10-Oct-11 13:40 
AnswerRe: Setting a bmp as a window background Pin
TheGreatAndPowerfulOz10-Oct-11 14:45
TheGreatAndPowerfulOz10-Oct-11 14:45 
GeneralRe: Setting a bmp as a window background Pin
jkirkerx10-Oct-11 16:01
professionaljkirkerx10-Oct-11 16:01 
GeneralRe: Setting a bmp as a window background Pin
jkirkerx10-Oct-11 16:14
professionaljkirkerx10-Oct-11 16:14 
GeneralRe: Setting a bmp as a window background Pin
Richard MacCutchan10-Oct-11 22:15
mveRichard MacCutchan10-Oct-11 22:15 
GeneralRe: Setting a bmp as a window background Pin
jkirkerx11-Oct-11 7:01
professionaljkirkerx11-Oct-11 7:01 
GeneralRe: Setting a bmp as a window background Pin
Richard MacCutchan11-Oct-11 7:43
mveRichard MacCutchan11-Oct-11 7:43 
GeneralRe: Setting a bmp as a window background Pin
jkirkerx11-Oct-11 8:41
professionaljkirkerx11-Oct-11 8:41 
I got it!, just finished. I doubled the size of the artwork, and just used a PNG file, and it loaded. Messed around with the numbers, and mode, came out great!.

I also made my Textout dynamic as well, but I ran into an math warning, I tried (double).38, but still got the error.

Anyways, Thanks for the pointers, I get this feeling that what I'm doing is old school, and that folks moved on to MFC or something.

warning C4244: 'argument' : conversion from 'double' to 'int', possible loss of data



VB
TextOut(hdc, clientRect.right * .38, clientRect.bottom * .03,
            L"IIS Webserver Installation",
            _tcslen(L"IIS Webserver Installation")
        );


// My new Code
C#
//////////////////////////////////////////////////////////////////////////////////////////
    //Setup the Windows Background First
    GetClientRect(cWnd, &clientRect);

    // Paint the Top User Interface White
    hRegion1 = CreateRectRgn(clientRect.left, clientRect.top, clientRect.right, clientRect.bottom - 57);
    hBGBrush1 = CreateSolidBrush(RGB( 255, 255, 255 ));
    FillRgn(hdc, hRegion1, hBGBrush1);

    // Paint the Bottom Navigation Black
    hRegion2 = CreateRectRgn(clientRect.left, clientRect.bottom - 57, clientRect.right, clientRect.bottom);
    hBGBrush2 = CreateSolidBrush(RGB( 25, 25, 25 ));
    FillRgn(hdc, hRegion2, hBGBrush2);

    // Load the bitmap background into the window
    bmp_BGInstallation = LoadBitmap(hIIS_Instance, MAKEINTRESOURCE(IDB_BG_INSTALL_PANE_PNG));
    mem_DCInstallation = CreateCompatibleDC(hdc);

    // Set the Background Image
    SelectObject(mem_DCInstallation, bmp_BGInstallation);

    // Compress the large bitmap image
    //BitBlt(hdc, 0, 0, 504, 306, mem_DCInstallation, 0, 0, SRCCOPY);
    SetStretchBltMode(hdc, COLORONCOLOR);
    StretchBlt(hdc, 0, 0, clientRect.right, clientRect.bottom - 57, mem_DCInstallation, 0, 0, 1008, 612, SRCCOPY);

    // Release the Bitmap Image
    DeleteDC(mem_DCInstallation);
    DeleteObject(bmp_BGInstallation);
    //////////////////////////////////////////////////////////////////////////////////////////

GeneralRe: Setting a bmp as a window background Pin
Richard MacCutchan11-Oct-11 10:56
mveRichard MacCutchan11-Oct-11 10:56 
GeneralRe: Setting a bmp as a window background Pin
CPallini10-Oct-11 22:28
mveCPallini10-Oct-11 22:28 
GeneralRe: Setting a bmp as a window background Pin
jkirkerx11-Oct-11 7:02
professionaljkirkerx11-Oct-11 7:02 
QuestionCDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Code-o-mat10-Oct-11 9:36
Code-o-mat10-Oct-11 9:36 
AnswerRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Richard MacCutchan10-Oct-11 10:26
mveRichard MacCutchan10-Oct-11 10:26 
GeneralRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Code-o-mat10-Oct-11 10:30
Code-o-mat10-Oct-11 10:30 
GeneralRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Richard MacCutchan10-Oct-11 10:34
mveRichard MacCutchan10-Oct-11 10:34 
GeneralRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Code-o-mat10-Oct-11 22:06
Code-o-mat10-Oct-11 22:06 
GeneralRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Code-o-mat10-Oct-11 23:15
Code-o-mat10-Oct-11 23:15 
AnswerRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Randor 10-Oct-11 12:26
professional Randor 10-Oct-11 12:26 
GeneralRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Code-o-mat10-Oct-11 22:03
Code-o-mat10-Oct-11 22:03 
GeneralRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Randor 11-Oct-11 17:01
professional Randor 11-Oct-11 17:01 
GeneralRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Code-o-mat10-Oct-11 23:09
Code-o-mat10-Oct-11 23:09 
GeneralRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Randor 11-Oct-11 17:35
professional Randor 11-Oct-11 17:35 
GeneralRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Code-o-mat12-Oct-11 0:43
Code-o-mat12-Oct-11 0:43 
GeneralRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
arnoudmulder12-Nov-18 7:07
arnoudmulder12-Nov-18 7:07 
GeneralRe: CDC::GetDeviceCaps, how to know if AlphaBlend is supported or not? Pin
Randor 22-Nov-18 19:23
professional Randor 22-Nov-18 19:23 

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.