Viperke
Aug 16th, 2000, 02:52 PM
Hello
I'm writing a program which displays a Meteosat weather image. This is written pixel by pixel.
There are 2 problems
* When Im writing the image, I can't do anything else in my program. And I need to be able to use the stop button, so I can stop writing my image....
* I also need to be able to redraw my image when my program has been dropped down. When I use the autoredraw property, then the screen stays blank until the image has been received, and is then displayed. The target is to see form the pixel by pixel, and line by line..
Anyone who can help me???
This is the code I use
For lijn = 0 To 44
'teller om 440 pixels per lijn te schrijven
tel = 0
'440 pixels = 55 karakters
For karakter = 1 To 55
' ontvangen van data van de DSK
inbuff = RcvData
If inbuff = -1 Then
' Timemout
MsgBox "Timeout opgetreden", vbCritical, "TIMEOUT!!!"
Else
' Conversie van decimaal naar binair
Binary = Int(inbuff / 128) & Int(inbuff / 64) Mod 2 & _
Int(inbuff / 32) Mod 2 & Int(inbuff / 16) Mod 2 & _
Int(inbuff / 8) Mod 2 & Int(inbuff / 4) Mod 2 & _
Int(inbuff / 2) Mod 2 & inbuff Mod 2
' voor elke bit een pixel uitschrijven
For bitje = 1 To 8
Bit = Mid(Binary, bitje, 1)
If Bit = 0 Then
' zwart
kleur = RGB(0, 0, 0)
Else
' wit
kleur = RGB(255, 255, 255)
End If
tel = tel + 1
' pixel uitschrijven
frmDocument.Picture1.PSet (tel, lijn), kleur
Next bitje
End If
Next karakter
Next lijn
TNX
Viperke
I'm writing a program which displays a Meteosat weather image. This is written pixel by pixel.
There are 2 problems
* When Im writing the image, I can't do anything else in my program. And I need to be able to use the stop button, so I can stop writing my image....
* I also need to be able to redraw my image when my program has been dropped down. When I use the autoredraw property, then the screen stays blank until the image has been received, and is then displayed. The target is to see form the pixel by pixel, and line by line..
Anyone who can help me???
This is the code I use
For lijn = 0 To 44
'teller om 440 pixels per lijn te schrijven
tel = 0
'440 pixels = 55 karakters
For karakter = 1 To 55
' ontvangen van data van de DSK
inbuff = RcvData
If inbuff = -1 Then
' Timemout
MsgBox "Timeout opgetreden", vbCritical, "TIMEOUT!!!"
Else
' Conversie van decimaal naar binair
Binary = Int(inbuff / 128) & Int(inbuff / 64) Mod 2 & _
Int(inbuff / 32) Mod 2 & Int(inbuff / 16) Mod 2 & _
Int(inbuff / 8) Mod 2 & Int(inbuff / 4) Mod 2 & _
Int(inbuff / 2) Mod 2 & inbuff Mod 2
' voor elke bit een pixel uitschrijven
For bitje = 1 To 8
Bit = Mid(Binary, bitje, 1)
If Bit = 0 Then
' zwart
kleur = RGB(0, 0, 0)
Else
' wit
kleur = RGB(255, 255, 255)
End If
tel = tel + 1
' pixel uitschrijven
frmDocument.Picture1.PSet (tel, lijn), kleur
Next bitje
End If
Next karakter
Next lijn
TNX
Viperke