Suppose I load a jpg texture, which has obviously no alha channel, can I set the global alpha channel somehow? MakeKeyColortexture just changes one color to the desired alpha.
yes, as soon as the texture is in memory it's stored in ARGB format...
so you can lock the texture, change the alpha values and unlock the texture again...
it's also possible with just using setPixel(...) but slower...
You could also change the alpha value of the vertex colors of the mesh you're rendering the texture on for a similar effect. No need to change the texture itself.
How would you? Lock returns a pointer to the start of the memory block that contains the texture data. It also "locks" the texture in that the rest of the system won't use it while you're modifying it. When you're done you unlock it so the system knows that it can use it again.
Another thing: I was wrong -makeColorKeyTexture makes the actual color completly transparent. Is there any stuff, to make it not fully transparent or should I change each pixel to the desired one by one?
I agree with slavik, this would all be much easier if you used a proper format. JPEG lacks transparency and uses a very lossy compression, so it is not well suited for textures.
I create my own textures , not static images, that would be easy. I solved the problem with simply using the GetPixel and PutPixel attribute of IImage, it isnt that slow.