Archived

This topic is now archived and is closed to further replies.

Blitting Surface larger than screen???

This topic is 5588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In DD, how can I blit a picture that is larger than the screen, so I would have parts of the picture off the screen? When ever I trie to do this, nothing displays and the screen just flickers. Please help! I''m using VB

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You need to clip your bitmap when you send it to the screen. In C++ there is the function BltFast( x, y, pdds, prc, dwFlags).
I''m sure there is a comparable VB function. x and y are the screen coords, pdds is the DirectDraw surface and prc is a RECT that contains the part of the surface to send. dwFlags is just flags to send.
The important part is the RECT. You need to figure out how much of your image is going to be on the screen and fill that info into a RECT and pass it in. Sorry I can''t post any VB code. Hope you can figure it out.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The reason why it is black is because you are trying to
display an image larger than the screen. This is the behaviour
of copyrect and similar functions in ddraw. What you need
to do is caculate the rect dimensions of the part of the source
you want to display and point it to 0.0 (or whereever) on your target surface.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Guys ....first attach CLipper to primary surface. Then use BLT insted of BLTFAST which don''t work with clipper. Then you can display any bitmap ewen 2x biger then screen. Clipper just cut graph. You can display bitmap if you want from -10,-10 coords and it will work fine. My suggestion ..... use VC.

Share this post


Link to post
Share on other sites
I would suggest testing with the clipper and only using Blt() but ultimately, its faster to use BltFast() and write your own clipper which modifies the src and dest rects to match available screen space. It takes some messing around to finally figure it out (at least it did a few years ago for me) but when you get your own clipper running it works VERY fast compare to the attached clipper.

Share this post


Link to post
Share on other sites