Click here to Skip to main content
15,900,110 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: connecting to mysql server in remote location .. Pin
Thilek5-Feb-09 23:18
Thilek5-Feb-09 23:18 
QuestionIShellFolder::SetNameOf() setting only virtual folders Pin
ab4rum5-Feb-09 2:26
ab4rum5-Feb-09 2:26 
AnswerRe: IShellFolder::SetNameOf() setting only virtual folders Pin
Stuart Dootson5-Feb-09 6:23
professionalStuart Dootson5-Feb-09 6:23 
GeneralRe: IShellFolder::SetNameOf() setting only virtual folders Pin
ab4rum7-Feb-09 0:28
ab4rum7-Feb-09 0:28 
QuestionNeed help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5025-Feb-09 2:13
John5025-Feb-09 2:13 
AnswerRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson5-Feb-09 3:03
professionalStuart Dootson5-Feb-09 3:03 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5025-Feb-09 20:04
John5025-Feb-09 20:04 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson5-Feb-09 21:34
professionalStuart Dootson5-Feb-09 21:34 
You need to offset the rectangle into which you're blitting by m_nScrollPos.

So, something like:

BitBlt(dc.m_hDC,70,180,rect.right,rect.bottom,memdc,0,0,SRCCOPY);


would become something like

BitBlt(dc.m_hDC,70,180-m_nScrollPos,rect.right,rect.bottom-m_nScrollPos,memdc,0,0,SRCCOPY);


Also - I don't think you should be using rect.bottom - that should be m_rcOriginalRect.bottom - you want to blit the images to fit into the original window size, not the current window size?

I've replicated your problem, anyway, before using this to fix it. Here's my paint code. I use CImage objects to hold the image (CImage isn't available in VC6 before you ask) and CRects to hold sizes. baseSize_ is equivalent to your m_OriginalHeight, while offset_ contains the current scroll position. The images are being blitted to each fill half of the original window size. This code works, anyway.

PAINTSTRUCT ps;
CDC* paintDC = BeginPaint(&ps);
CRect rcImage1(baseSize_);
rcImage1.bottom /= 2;
CRect rcImage2;
rcImage2.SubtractRect(baseSize_, rcImage1);
rcImage1.OffsetRect(-offset_);
rcImage2.OffsetRect(-offset_);
image1_.StretchBlt(*paintDC, rcImage1, SRCCOPY);
image2_.StretchBlt(*paintDC, rcImage2, SRCCOPY);
EndPaint(&ps);


HTH!!!
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 5:13
John5026-Feb-09 5:13 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 5:50
professionalStuart Dootson6-Feb-09 5:50 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 6:24
John5026-Feb-09 6:24 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 7:16
professionalStuart Dootson6-Feb-09 7:16 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 7:35
John5026-Feb-09 7:35 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 8:03
professionalStuart Dootson6-Feb-09 8:03 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5028-Feb-09 4:14
John5028-Feb-09 4:14 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 6:38
professionalStuart Dootson8-Feb-09 6:38 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5028-Feb-09 7:05
John5028-Feb-09 7:05 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 8:01
professionalStuart Dootson8-Feb-09 8:01 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5028-Feb-09 9:59
John5028-Feb-09 9:59 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 10:28
professionalStuart Dootson8-Feb-09 10:28 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 22:07
professionalStuart Dootson8-Feb-09 22:07 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5029-Feb-09 3:05
John5029-Feb-09 3:05 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John50210-Feb-09 7:00
John50210-Feb-09 7:00 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson10-Feb-09 8:17
professionalStuart Dootson10-Feb-09 8:17 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John50210-Feb-09 20:45
John50210-Feb-09 20:45 

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.