Discussion: [PSP][Résolu] draw images on images
Afficher un message
Vieux 04/06/2007, 17h25   #6
Brunni
Super Modérateur
 
Date d'inscription: 10/11/2005
Localisation: Un pays avec beaucoup de banques
Messages: 3 229
Par défaut

Citation:
Envoyé par ninjaglowskulls Voir le message
the code in my first post doesn't work. Basically all the pixels in the "charc" image are transparent, and when I try to draw to it with another image, all my new pixels are transparent as well. So there is nothing on the screen.

I used:
oslClearImage(charc, RGB(128,0,128)); //pink colour
oslSetTransparentColour(RGB128,0,128);

and it kinda did what I was looking for. The only problem is that on my original PNG file, there are semi-transparent pixels, so everything gets drawn with a pinkish border. What I was wondering, is there a way to initialize my "charc" image, without using a colour, and draw my other images on to it.
Could I set the oslSetAlpha(int, int) function to one of the flags, and draw it that way? And If so which one should I use?

This is my only problem, and it's been bugging me for about 3 days now. grrr. The worst part is, I'm just being and don't want to do the math to re-align everything everytime my picture changes direction.
This has really been a big problem for me when designing OSLib, because it's a limitation from the hardware and this behaviour seems not very logical. Basically the hardware will write red, green and blue components to the current drawbuffer, but won't write the alpha channel.
In the version 2.0 there's an experimental function that would allow you to do it, search in the documentation in the Images, Drawbuffers section, you may be able to do what you want with alpha testing and alpha write (which is basically a tricky method using the fact that the stencil buffer is shared with the alpha buffer on PSP; it won't work on the PC version btw).
Brunni est déconnecté   Réponse avec citation