Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in Programming. |
Acmlm's Board - I3 Archive - Programming - Layering via BitBlt | New poll | | |
Add to favorites | Next newer thread | Next older thread |
User | Post | ||
interdpth Mole MZM rapist Since: 11-18-05 Last post: 6432 days Last view: 6432 days |
| ||
Ok, well i'm working on a level editor and now I got to the part where I need to work with Layers. I'm not sure the Raster Operations to use, i'm using Sourcepaint since sourcecopy kills the other layers
I'm working with 3 layers I know which layer needs to go on top of which but i'm not sure how to go about it because some turn out out to be transparent which is not what I need so anyhelp? Here's the pic if anyone is interested (edited by interdpth on 08-29-06 05:59 PM) |
|||
HyperHacker Star Mario Finally being paid to code in VB! If only I still enjoyed that. <_< Wii #7182 6487 4198 1828 Since: 11-18-05 From: Canada, w00t! My computer's specs, if anyone gives a damn. STOP TRUNCATING THIS >8^( Last post: 6432 days Last view: 6432 days |
| ||
Use TransparentBlt. | |||
interdpth Mole MZM rapist Since: 11-18-05 Last post: 6432 days Last view: 6432 days |
| ||
Ok, exactly how do I go about doing it though? | |||
HyperHacker Star Mario Finally being paid to code in VB! If only I still enjoyed that. <_< Wii #7182 6487 4198 1828 Since: 11-18-05 From: Canada, w00t! My computer's specs, if anyone gives a damn. STOP TRUNCATING THIS >8^( Last post: 6432 days Last view: 6432 days |
| ||
BitBlt the lowest layer onto your window, then TransparentBlt the next highest layers on in order of depth. Or better, do all this on a temporary buffer and then BitBlt that to the window to reduce flicker. | |||
interdpth Mole MZM rapist Since: 11-18-05 Last post: 6432 days Last view: 6432 days |
| ||
Can I see a code example or something, I know how to regluar bitblt, but this kind of confuses me, seeing as how I have to give a color instead of an operation. | |||
HyperHacker Star Mario Finally being paid to code in VB! If only I still enjoyed that. <_< Wii #7182 6487 4198 1828 Since: 11-18-05 From: Canada, w00t! My computer's specs, if anyone gives a damn. STOP TRUNCATING THIS >8^( Last post: 6432 days Last view: 6432 days |
| ||
The colour is just whatever colour you don't want to be copied. Fill layer 2 with that colour, draw things on each layer, BitBlt layer 1 to the window, then TransparentBlt layer 2 to it specifying that colour. You should see layer 2 overtop of layer 1.
TransparentBlt works almost exactly the same as BitBlt, I don't know how you can be so confused about it. (edited by HyperHacker on 08-30-06 06:55 PM) |
|||
interdpth Mole MZM rapist Since: 11-18-05 Last post: 6432 days Last view: 6432 days |
| ||
The reason I don't get is this is because I have 3 seperate functions drawing to the HDC. all using bitblt and SRCPAINT. My first attempt at the transparentblit just killed the other layers besides the one i was transparentblitting so that's why I don't get it | |||
sloat Since: 11-18-05 From: Delaware, US Last post: 6535 days Last view: 6535 days |
| ||
If it's that confusing, just don't use BitBlt at all then. Clear the background using ExtFloodFill or FillRect (whichever works better for you), and just use TransparentBlt to do all your drawing.
Chances are it won't show up properly anyway since, IIRC, the SNES uses the palette index to indicate transparency and not the color value. Probably the best solution would be to do masking for each tile, and draw each with BitBlt using a SRCAND-SRCPAINT double blit. Another solution would be to change the color value of palette index 0 to something that isn't in the game...then you can use TransparentBlt with no ill effects. Generating masks on the fly and changing pixel colors present their own problems -- the most noticable would be how slow the pixel manipulation functions are. Unless you're prepared to jump in to the fun fun world of DIBs, you should stick with broken rendering, or... Using a separate, static bitmap mask would work. But then, that's another file to add to your project. btw, TransparentBlt hates Windows 98. It will cause huge memory leaks, and may not even work at all. |
|||
HyperHacker Star Mario Finally being paid to code in VB! If only I still enjoyed that. <_< Wii #7182 6487 4198 1828 Since: 11-18-05 From: Canada, w00t! My computer's specs, if anyone gives a damn. STOP TRUNCATING THIS >8^( Last post: 6432 days Last view: 6432 days |
| ||
It's GBA but I believe the same rules apply. |
Add to favorites | Next newer thread | Next older thread |
Acmlm's Board - I3 Archive - Programming - Layering via BitBlt | | |