How to use the canvas to draw a semi-transparent image ?

I want to place a picture on the canvas , you can freely change the picture of transparency
How to achieve it ?
Thank you

Put a canvas on a window. Call it Canvas1. Put a slider on the window. Set it’s Maximum to 255. Add the ValueChanged event to the slider. Put in this code (where pic1 is your image).

pic1.mask.graphics.forecolor= rgb(me.value, me.value, me.value)
pic1.mask.graphics.fillrect(0,0,pic1.width, pic1.height)
canvas1.Invalidate

Add the Paint event to the canvas and put in this code.

g.DrawPicture pic1, 0, 0

Run the project and adjust the slider. You can turn on LiveScroll on the slider if you wish.

Thank you, this is what I want

But when I move the canvas there is a new problem , the process of moving , flashing canvas is very powerful , and how to make the canvas when moving , not blinking it? Or is my method wrong ?
this my code:

Add the action event to the Timer and put in this code.

if iCount < 255 then
Canvas1.Left = Canvas1.Left +10
iCount = iCount + 10
h1.mask.graphics.forecolor= rgb(iCount,iCount,iCount)
h1.mask.graphics.fillrect(0,0,h1.width,h1.height)
canvas1.Invalidate
end if

Add the Paint event to the canvas and put in this code.
g.DrawPicture h1, 0, 0