Skip to main content
gamedev.net
🔒 Locked

50% transparent image

Started by gerbenvanderlubbe Aug 11, 2003 at 1:15 PM 2 replies 400+ views
Original Post
gerbenvanderlubbe
gerbenvanderlubbe
I have to images. One buffer and one image I want to put on the buffer. This image must be put on the buffer with ±50% transperency, so that you can "look through" it. How can I do this? I got the two DCs of the pictures and stuff. I tried to do it manually with Set/GetPixel, but that was way to slow! BitBlt with SRCPAINT wasn''t what I was expecting either. so how can I do it? Preferably that it''s customisable for example that I can change it to 40% tranperency. Thanks
Michalson
Michalson
What API are you using? Under plain vanilla GDI it will be slow no matter what. Under DirectDraw you can make it a bit faster but only to a point (most of the cpu power will be spent doing just one image). What you need is to use hardware acceleration (OpenGL/Direct3D) to do the blending for you. The only question is if you want this for realtime effects or for file processing. If it''s for file processing (you are taking 2 images, combining them, and then saving the result) you should remove the graphics API part completely, and instead load the images into regular arrays where you can quickly access and blend the values.
VolkerG
VolkerG
Another option: use GDI+ if it is just a windows application.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.