I try to write a little pixelization program but at the start it looks like criticaly slow...
Please check my code and tell me how can I improve the speed faster! :sign0163:
Thank you
Please check my code and tell me how can I improve the speed faster! :sign0163:
Thank you
B4X:
Sub Globals
'Declare the global variables here.
Dim Type(Alpha, Red, Green, Blue) col As byte
End Sub
Sub App_Start
web.New1("Form1",240,0,240,270)
cap.New1
img.New1
web.Navigate("http://www.youtube.com/watch?v=UD3XJDhstNo&feature=related")
Form1.Show
End Sub
Sub Timer1_Tick
Dim i, j
cap.ControlCapture(web.ControlRef,0,0,web.Width,web.Height)
cap.FastPixelsStart
img.FastPixelsStart
For j = 0 To 269
For i = 0 To 239
col() = cap.FastGetPixel(i, j)
img.FastSetPixel(i, j, col.Alpha, col.Red, col.Green, col.Blue)
Next
Next
cap.FastPixelsEnd
img.FastPixelsEnd
Image1.Image=img.Image
Timer1.Enabled=False
Msgbox()
End Sub
Sub Button1_Click
Timer1.Enabled=True
End Sub