someone can give me a sugestion to make this?
user need scratch to find the prize *-*
i remember have this tutorial in many time ago on the forum but i dont find this *-*
But it will be very slow.Calculate how many "Pixel" the image have in total.
Check each pixel if it is a transparent one.
With a little bit algebra you should be able to calculate how many % is transparent.
I have tried it but i feel it not to be "very slow"?But it will be very slow.
Dim p() As Int p = getPixels(SD.Canvas.Bitmap, 0, 0, 0, 0, SD.Canvas.Bitmap.Width, SD.Canvas.Bitmap.Height) 'Log("SizeOf(p)="&p.Length) Dim MaxPixels As Long = p.Length Dim TransPixels As Long = 0 For Each pdummy As Int In p Dim alpha As Int = Bit.UnsignedShiftRight(Bit.AND(pdummy, 0xff000000), 24) If alpha = 0 Then TransPixels = TransPixels +1 End If Next Dim found As Float = (TransPixels/MaxPixels)*100 Log("Scratched= "&NumberFormat(found,0,0)&"%")