BBC BASIC for Windows
Programming >> Graphics and Games >> DrawIconEx
http://bb4w.conforums.com/index.cgi?board=graphics&action=display&num=1329675408

DrawIconEx
Post by admin on Feb 19th, 2012, 5:16pm

The DrawIconEx API can 'reflect' the icon about the X and/or Y axis simply by changing the sign of the width and/or height parameters. However this is undocumented so it isn't safe to rely on it, and it only works with an 'old' style icon with a separate mask, not a 32-bpp icon with linear alpha.

As I needed to be able to draw 32-bpp icons, and reflect them about either axis, I have written my own replacement for DrawIconEx. Functionally it's similar to the API version, except that both the background bitmap and the icon must be 32-bpp bottom-up DIBs, and rather than bitmap handles the routine takes as parameters pointers to DIBSECTION structures:

Code:
SYS DrawIconExRTR, dibsback{}, xpos%, ypos%, dibsicon{}, width%, height% 

The code is less than 256 bytes and is completely position-independent, so it may be loaded as a binary image at any address you like.

Edit: The scaling is only 'nearest neighbour'.

Richard.