This project is read-only.

Blit Quad from Source->Dest

Sep 29, 2011 at 3:30 PM
Edited Sep 29, 2011 at 3:31 PM

Hi there,

I have an interesting problem - I need to blit multiple quads from source image to destination.

x2,y1 |\
         |  \ x2,y2
         |   |
x4,y4|__| x3,y3

Quads are going to be shaped like the above (forgive the lame ascii art!). I notice there's a Blit with Rect method, and a draw quad method, I'm wondering has anyone attempted combining these before I give it a go myself? (with disastrous consequences :P)

Many thanks,

Sep 29, 2011 at 5:41 PM

Great idea! I can see that being pretty useful. I've done something similar in the past but I did it a very... perhaps inefficient way.
What I did was to create another bitmap, filled with #00000000, then draw the quad or whatever other shape onto the surface of that bitmap in black. Then I mask blit the image I only want part of with the mask I created above onto another bitmap. That leaves me with a piece, matching the mask. I can use that to blit the shape onto a final bitmap. Obviously this wouldn’t be any good if you need to continue to change the mask. Also, my bitmaps were small, I could see large bitmaps suffering from this method. As a startup process I create all the various shapes I need and have them ready for the rest of the run.

If WritebleBitmapEx offers a way to do this in the way you describe or you come up with one I’d be interested!