Wednesday, December 20, 2006

Alpha Blending on SmartPhone

I created a quick test app to experiment with the performance of the P/Invoke AlphaBlend calls as discussed in this blog post by Chris Lorton. The AlphaBlend native call does not support per-pixel alpha blending so the alpha value is specified for the entire image. The "incr" label in these two videos is the step value for the alpha channel used in the animation. The frame rates were better than expected, right around 17-20fps.

The tool I am using to record the video is called CoolCapture (I'm using the trial version here). It's very cool. It's essentially a fully featured screen capture tool for Windows Mobile 5 devices. You can generate both videos or pictures. I was fairly impressed with the performance as well; capturing these two videos below only resulted in about a ~6 fps reduction in my animation (thus the blending doesn't look as smooth as it actually is). The trial version limits the recording interval to ~10 seconds (though the webpage says 5 seconds).

Note that the capture resolution was 240x320 (the device resolution); however, this was automatically changed to 640x480 when I uploaded the video to YouTube. This is why the videos have that stretched out look.

1 comment:

Anonymous said...

I´ve tried the AlphaBlend() function how described in Chris Lortons blog, but it always fails with a ERROR_INVALID_PARAMETER exception. Can you show me your code or maybe tell me what´s the trick with it?

Greetings BenPa
(b-2000-pabst at web.de)