Blitting Surface larger than screen???

Started by
4 comments, last by Rad76 21 years, 7 months ago
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
Advertisement
Such happened to me before. You have to clip , your surface , so only parts that will be visible are blitted and nothing else.
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.
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.
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.
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.

This topic is closed to new replies.

Advertisement