Click here to Skip to main content
15,891,513 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CORBA - NameService Pin
torpedus26-May-05 23:02
torpedus26-May-05 23:02 
GeneralRe: CORBA - NameService Pin
Bob Stanneveld26-May-05 23:28
Bob Stanneveld26-May-05 23:28 
Generallanguage and AFX_TARG_... question Pin
tim63526-May-05 22:21
tim63526-May-05 22:21 
GeneralInsert my Win32 window into an MFC Dialog Pin
anderslundsgard26-May-05 21:45
anderslundsgard26-May-05 21:45 
GeneralCWnd::CreateControl copy/paste problem Pin
Johan O26-May-05 20:40
Johan O26-May-05 20:40 
GeneralRe: CWnd::CreateControl copy/paste problem Pin
Ryan Binns27-May-05 2:34
Ryan Binns27-May-05 2:34 
GeneralRe: CWnd::CreateControl copy/paste problem Pin
Johan O27-May-05 9:41
Johan O27-May-05 9:41 
GeneralCBitmap.GetBitmapDimensions() problem Pin
toxcct26-May-05 20:36
toxcct26-May-05 20:36 
no no, i'm not spaming the forum... Blush | :O

i have the following code :
BOOL CMSILauncherDlg::OnEraseBkgnd(CDC* pDC) {
    <font color=green>// To Paint the BackGround with the IDB_BGND bitmap</font>
    CBitmap BackGroundBitmap;
    BackGroundBitmap.LoadBitmap(IDB_BGND);
    CDC MemDC; 
    MemDC.CreateCompatibleDC(pDC);
    MemDC.SelectObject(&BackGroundBitmap);
 
    CRect ClientRect;
    GetClientRect(&ClientRect);
    CPoint OriginPoint(0, 0);
    CSize BGBitmapSize(BackGroundBitmap.GetBitmapDimensions().cx, 
                       BackGroundBitmap.GetBitmapDimensions().cy);
    <font color=blue>for</font> (OriginPoint.y = ClientRect.top; OriginPoint.y < ClientRect.bottom; OriginPoint.y += BGBitmapSize.cy) {
        <font color=blue>for</font> (OriginPoint.x = ClientRect.left; OriginPoint.x < ClientRect.right; OriginPoint.x += BGBitmapSize.x) {
            pDC->BitBlt(OriginPoint.x,
                        OriginPoint.y,
                        BGBitmapSize.cx,
                        BGBitmapSize.cy,
                        &MemDC,
                        0,
                        0,
                        SRCCOPY);
        }
    }
    <font color=blue>return</font> 1;
}

the above code doesnt work till the BackGroundBitmap.GetBitmapDimensions() return {0, 0} as size...
if i manually replace the function calls by the actual bitmap size, the function work quite fine (in fact, the bitmaps are not well "mosaic-ed" but spaced - maybe a unit problem).

<font color=green>// this does work</font>
CSize BGBitmapSize(BackGroundBitmap.GetBitmapDimensions().cx,
                   BackGroundBitmap.GetBitmapDimensions().cy);

<font color=green>// this works</font>
CSize BGBitmapSize(190, 187);

<font color=green>// this works too</font>
BackGroundBitmap.SetBitmapDimensions(190, 187);
CSize BGBitmapSize(BackGroundBitmap.GetBitmapDimensions().cx,
                   BackGroundBitmap.GetBitmapDimensions().cy);


does anyone already encountered this problem ?
any suggestions or solutions ?



TOXCCT >>> GEII power
[toxcct][VisualCalc]
GeneralRe: CBitmap.GetBitmapDimensions() problem Pin
PJ Arends26-May-05 22:12
professionalPJ Arends26-May-05 22:12 
GeneralRe: CBitmap.GetBitmapDimensions() problem Pin
toxcct26-May-05 22:19
toxcct26-May-05 22:19 
GeneralRe: CBitmap.GetBitmapDimensions() problem Pin
PJ Arends26-May-05 22:29
professionalPJ Arends26-May-05 22:29 
GeneralRe: CBitmap.GetBitmapDimensions() problem Pin
Gary R. Wheeler28-May-05 2:45
Gary R. Wheeler28-May-05 2:45 
GeneralRe: CBitmap.GetBitmapDimensions() problem Pin
toxcct28-May-05 6:42
toxcct28-May-05 6:42 
QuestionEnumWindows usage ? Pin
toxcct26-May-05 20:22
toxcct26-May-05 20:22 
AnswerRe: EnumWindows usage ? Pin
22491726-May-05 21:14
22491726-May-05 21:14 
AnswerRe: EnumWindows usage ? Pin
ThatsAlok26-May-05 21:32
ThatsAlok26-May-05 21:32 
QuestionHow to Prevent Switching of Controls of Views in a Multiple View SDI Application using splitter window Pin
nripun26-May-05 19:48
nripun26-May-05 19:48 
GeneralAbout Serializaiton Pin
VPNampoothiri26-May-05 19:47
VPNampoothiri26-May-05 19:47 
GeneralWrong assembly copied during build Pin
RockyMu26-May-05 19:04
RockyMu26-May-05 19:04 
GeneralWhat's the compiler setting ... Pin
WREY26-May-05 16:43
WREY26-May-05 16:43 
GeneralRe: What's the compiler setting ... Pin
geo_m26-May-05 18:31
geo_m26-May-05 18:31 
GeneralRe: What's the compiler setting ... Pin
Bob Stanneveld26-May-05 20:48
Bob Stanneveld26-May-05 20:48 
GeneralRe: What's the compiler setting ... Pin
WREY26-May-05 22:37
WREY26-May-05 22:37 
GeneralRe: What's the compiler setting ... Pin
Bob Stanneveld26-May-05 22:49
Bob Stanneveld26-May-05 22:49 
QuestionWhat to learn: MFC for C++ or Windows API? Pin
CorvetteZ060626-May-05 16:40
CorvetteZ060626-May-05 16:40 

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.