natty Posted July 20, 2006 Share Posted July 20, 2006 hello, I am new about directdraw, I recently setup directx9 and wanna load and display some pictures in my MFC program.Here are my steps:the MFC program is a single document program and created by the AppWizard and the VIEW class is derived from CScrollView. Firstly I created a primary surface and a offscreen surface in CMainFrame::OnCreateClient();Then in OnCreateClient(), I use BitBlt() to copy some picture files onto the offscreen surface.Finally,in CMyView::OnDraw(), I use Blt() to copy the offscreen surface to primary surface.The program is running all right , But when I OnSize or Drag the HBar(VBar), the picture should move but not.I think that the coordinate argument of the Blt() should be a variable instead of a constant, and I need to add some codes in OnHScroll(), OnVScroll(), OnSize(), OnMove().So there are two questions I would like to ask:1.Is my method RIGHT if I want to use directdraw in View in a single document program ?2.Whether I need to manually override and add some codes in OnMove(),OnSize(),etc. And what codes should I add? Is there any sample?the second question has made me nearly mad, I found lots of sample and document, but all of them is just display a picture in VIEW, never mentioned the movement situation. Thank you ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now