retrieving alpha channel value


Will this code retrieve the alpha channel value?

It seems not to. I can get red, green and blue values.
Please advise,


OPEN Event
dim alphaValue as integer
dim Pic as picture
Pic=new picture(canvas.width, canvas.height)
canvas.DrawInto(Pic.Graphics, 0, 0)
dim rgbs as RGBSurface

MouseDown Event
Dim PixelColor As Color
pixelColor=rgbs.Pixel(xPixel, yPixel) <---- does this pick up the alpha channel?

The problem is that you’re working the wrong way around. Store your Picture, read the alpha value from that via RGBSurface and use the Picture to draw onto your canvas when you want to display it.

Here’s a little example, give it a run, click on the pink rectangle and take a look at the debug output.