Questions about Memory DC's, BitBlt()...
Is it possible to select a certain rectangle from the source memory DC to blit to the window/screen DC? In other words, if I have a background on my game, and I only want to redraw a small portion of it, is it possible to specify a rectangle for the portion of the source bitmap that I want to blit?
Second Question, is it possible to set up a flipping scheme using this function? Would it be beneficial for me to do so, or does the performance loss outweight the benefits? I learned about flipping and what it's all about, and it doesn't sound like it'd be difficult to implement, especially if question #1 is a possibility.
Thanks! Oh, and pardon my verbage. Win32 is my second language.
Edit: Yes and that statement includes calling Win32 a language.
[edited by - utwo on February 11, 2003 11:33:27 AM]
[edited by - utwo on February 11, 2003 11:33:59 AM]
---signature---" Actually, at the time, I didn't give a damn about the FoxNews issue... just that you would come swooping in with your Super Mith cape flapping behind you and debunk it just because it didn't happen in your living room." - InnocuousFox
1) See BitBlt for 1:1 blitting and StretchBlt for scaled blitting.
2) Yes. You could have an offscreen DC which you use to build up the displayed image then blit that to the screen (so you don''t see the application rendering). This would also speed up redrawing the client when an obscuring window is (re-)moved. The downside is that it does use up memory and that you will need to ensure the client area and the offscreen DC are the same size.
Skizz
2) Yes. You could have an offscreen DC which you use to build up the displayed image then blit that to the screen (so you don''t see the application rendering). This would also speed up redrawing the client when an obscuring window is (re-)moved. The downside is that it does use up memory and that you will need to ensure the client area and the offscreen DC are the same size.
Skizz
Thanks. Taking a look at BitBlt(), just to make sure I have this correct:
Suppose I have a bitmap on a source DC that''s 100x100, but I only want to blit the portion from 5,5 to 14,14 to the screen, and have it appear on the screen at 50,50. Would calling the function this way work?
BOOL BitBlt(DestDC, 50, 50, 10, 10, SourceDC, 5, 5, SRCCOPY);
Suppose I have a bitmap on a source DC that''s 100x100, but I only want to blit the portion from 5,5 to 14,14 to the screen, and have it appear on the screen at 50,50. Would calling the function this way work?
BOOL BitBlt(DestDC, 50, 50, 10, 10, SourceDC, 5, 5, SRCCOPY);
---signature---" Actually, at the time, I didn't give a damn about the FoxNews issue... just that you would come swooping in with your Super Mith cape flapping behind you and debunk it just because it didn't happen in your living room." - InnocuousFox
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement