public override float GetTextureAlpha(object textureHandle, Point p) { Texture texture = SafeResolveTexture(textureHandle); if (p.X > texture.Width || p.Y > texture.Height) { return(0); } using (var buffer = texture.GetBuffer()) { var pb = buffer.Lock(new Box(p.X, p.Y, p.X + 1, p.Y + 1), HardwareBuffer.LockOptions.HBL_DISCARD); unsafe { ColourValue cv; ColourValue *cvptr = &cv; PixelUtil.UnpackColour(cvptr, PixelFormat.PF_BYTE_RGBA, pb.data.ToPointer()); buffer.Unlock(); return(cv.A); } } }