Some missing info in your first post.

- We don't see where UnmaskAlpha() is called from.
- How is Dest: TBitmap created before sending as parameter?
- You are typecasting it, so couldn't it be procedure UnmaskAlpha(Dest: bmp2xlbmp);
- What is bmp2xlbmp anyway?