Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private ImageView1 As B4XView
Private bc1 As BitmapCreator
End Sub
Public Sub Initialize
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
Dim bmp As B4XBitmap = xui.LoadBitmap(File.DirAssets, "33472.jpg")
bc1.Initialize(bmp.Width, bmp.Height)
bc1.CopyPixelsFromBitmap(bmp)
bc1.SetBitmapToImageView(bc1.Bitmap, ImageView1)
End Sub
Private Sub Button1_Click
ShiftUpRow(bc1, 10)
bc1.SetBitmapToImageView(bc1.Bitmap, ImageView1)
End Sub
Private Sub ShiftUpRow (bc As BitmapCreator, NumberOfRows As Int)
Bit.ArrayCopy(bc.Buffer, bc.mWidth * 4 * NumberOfRows, bc.Buffer, 0, bc.mWidth * 4 * (bc.mHeight - NumberOfRows))
End Sub