The "Transparent" property of TBitmap is a ancient feature from the last century. A certain color of the image is made transparent by not painting it. Instead, use the Alpha channel for "true" transparency which makes the background partially shine through. png is the image format which is well-prepared for this feature.
I am attaching a demo with a transparent png image. You can move the image by dragging it with the left mouse button, and you can zoom by means of the mouse wheel. Instead of a TImage I am painting to a TPaintbox because it gives me more control of what is happening. But TImage should work in principle similarly.
There are two options:
- Original bitmap: stretches the original image onto the painting canvas. Moving it with the mouse is a bit sluggish because StretchDraw is executed with every pixel moved, and this is an expensive operation
- Stretched bitmap: Does not paint the original image but a stretched bitmap created only when needed. The stretchdraw operation uses a routine from the Lazarus wiki (https://wiki.freepascal.org/Developing_with_Graphics#Using_the_non-native_StretchDraw_from_LazCanvas) which retains the alpha channel. Interpolation is made with the TFPSharpInterpolation, but there are others in unit FPCanvas, see https://wiki.freepascal.org/fcl-image. Since the current procedure stretches the entire image calculation will become noticably slow at high zoom levels - this could be improved by processing only the part of the original image which is visible.
Of course, you could also use the BGRABitmap or Graphics32 libraries instead which are optimized for high performance. You can find them easily using the Online-Package-Manager of Lazarus.
[P.S.]
I could not include the image displayed because the zip file would have become too large. You can download it from
http://pngimg.com/download/1156 (or simply use one of your own images and adjust the file name in FormCreate.