Sub Prepara
Dim larg, lung, fill, padding, length, i, y, centro As Int
Dim mom, mom2 As String
centro = 0
If File.Exists(Main.Workingfolder, "Img1.bmp") Then
Dim instream As InputStream = File.OpenInput(Main.Workingfolder, "Img1.bmp")
Else
Return
End If
length = instream.BytesAvailable
Dim BufferImg(length) As Byte
instream.ReadBytes(BufferImg, 0, instream.BytesAvailable)
''''''''preparazione buffer grafico
larg = ((Bit.And(255, BufferImg(19)) * 256 ) + Bit.And(255,BufferImg(18))) /8
fill = larg Mod 4
For i = 62 To length - 1
For y = 0 To larg - 1
mom2 = Chr(Bit.Not(BufferImg(y+i)) + 256)
mom = mom & mom2
Next
'''''''''''''segue correzzione per divisibilità per 4
If fill > 0 Then i = i + fill
'''''''''''''''''''''''''''''''''''''''''''''''''''''
i = i + (larg - 1)
Next
larg = larg + centro
'''''''''''''''''''''''''''''''''''''''''''''''''''''
lung = Bit.And(255, BufferImg(22))
buffer_st.Append(Chr(29) & Chr(118) & Chr(48) & Chr(51) & Chr(larg) & Chr(0) & Chr(lung) & Chr(0) & mom & Chr(10)
End Sub