Version=6.80 NumberOfForms=1 Form1=Form1 FormWidth=238 FormHeight=268 IconFile=C:\Users\The Boss\Desktop\My IR Project\BTPicPPC\cpl.ico NumberOfDesktopIncludes=4 DesktopInclude1=Serial2.dll DesktopInclude2=Bitwise.dll DesktopInclude3=ImageLib.dll DesktopInclude4=BinaryFile.dll NumberOfDeviceIncludes=4 DeviceInclude1=Serial2.dll DeviceInclude2=Bitwise.dll DeviceInclude3=ImageLib.dll DeviceInclude4=BinaryFile.dll NumberOfObjects=4 Object1=bit:Bitwise Object2=bin:BinaryFile Object3=serial:Serial Object4=bm:Bitmap NumberOfModules=0 Sub designer addform(Form1,"Form1","",211,211,211)@ addbutton(form1,Button6,125,230,100,23,"Show Img",212,208,200,0,0,0,True,True,9)@ addbutton(form1,Button5,125,175,100,23,"Open Img dat",212,208,200,0,0,0,True,True,9)@ addbutton(form1,Button3,125,150,100,23,"Send Img dat",212,208,200,0,0,0,True,True,9)@ addopendialog(form1,OpenDialog1,205,115,All|*.*)@ addsavedialog(form1,SaveDialog1,160,120,Dat|*.dat)@ addbutton(form1,Button4,10,140,75,23,"Open Img",212,208,200,0,0,0,True,True,9)@ addbutton(form1,Button2,125,200,100,23,"Save Img dat",212,208,200,0,0,0,True,True,9)@ addbutton(form1,Button1,10,170,75,23,"Read Img",212,208,200,0,0,0,True,True,9)@ addimage(form1,Image1,15,205,84,48,"cCenterImage","",245,245,220,True,True)@ addbutton(form1,strbut,100,35,45,23,"str",212,208,200,0,0,0,True,True,9)@ addtextbox(form1,strbox,145,35,85,21,"0",255,255,255,0,0,0,True,True,False,9)@ addtextbox(form1,ey2,110,110,40,21,"0",255,255,255,0,0,0,True,True,False,9)@ addtextbox(form1,ex2,65,110,40,21,"0",255,255,255,0,0,0,True,True,False,9)@ addbutton(form1,xit,190,5,45,23,"exit",212,208,200,0,0,0,True,True,9)@ addbutton(form1,vrs,145,5,45,23,"vrs",212,208,200,0,0,0,True,True,9)@ addbutton(form1,clrs,100,5,45,23,"cls",212,208,200,0,0,0,True,True,9)@ addbutton(form1,line,160,85,40,23,"line",212,208,200,0,0,0,True,True,9)@ addtextbox(form1,ey,110,85,40,21,"0",255,255,255,0,0,0,True,True,False,9)@ addtextbox(form1,ex,65,85,40,21,"0",255,255,255,0,0,0,True,True,False,9)@ addbutton(form1,posit,5,85,50,23,"pos",212,208,200,0,0,0,True,True,9)@ addtextbox(form1,TextBox1,5,30,90,50,"TextBox1",255,255,255,0,0,0,True,True,True,9)@ addbutton(form1,close,50,5,45,23,"Close ",212,208,200,0,0,0,True,True,9)@ addbutton(form1,Open,5,5,45,23,"Open",212,208,200,0,0,0,True,True,9)@ End Sub @EndOfDesignText@ Sub Globals bite1="" bite2="" bite3="" bite4="" bite5="" Dim byt(1) As byte Dim rw1(6,84) Dim th(504) As byte z="" End Sub Sub App_Start Form1.show Sip=False serial.New2(6,9600,"N",8,1) bit.New1 opendialog1.Filter="Mine|*.dat;*.bmp" End Sub Sub Open_Click ErrorLabel(lab1) serial.PortOpen=True textbox1.Text=serial.PortOpen Return lab1: textbox1.Text="Fail" End Sub Sub close_Click serial.PortOpen=False textbox1.Text=serial.PortOpen End Sub Sub dot(a,b) End Sub Sub posit_Click pos(ex.Text,ey.Text) End Sub Sub line_Click lines(ex.Text,ey.Text,ex2.Text,ey2.Text) End Sub Sub clrs_Click clr End Sub Sub vrs_Click about End Sub Sub xit_Click AppClose End Sub Sub strbut_Click string(ex.Text,ey.Text,strbox.Text) End Sub Sub about Serial.Output("F") End Sub Sub pos(x,y) Serial.Output("P") byt(0)=x serial.Output2(byt()) byt(0)=y serial.Output2(byt()) End Sub Sub string(x,y,c) pos(x*8,y*8) a=StrLength(c) Serial.Output("S") byt(0)=a serial.Output2(byt()) For b = 0 To a-1 Serial.Output(StrAt(c,b)) Next End Sub Sub lines(x,y,a,b) pos(x,y) Serial.Output("L") byt(0)=a serial.Output2(byt()) byt(0)=b serial.Output2(byt()) End Sub Sub clr Serial.Output("N") End Sub Sub Button1_Click 'read img y2=0 y1=0 For y= 0 To 47 Step 8 For x = 0 To 83 For a = 0 To 7 If bm.GetPixel1(x,y+a)+1 =0 Then b=bit.ClearBit(z,a) z=b Else b=bit.SetBit(z,a) z=b End If 'rw1(y2,x)=z th(y1)=z Next y1=y1+1 Next y2=y2+1 Next Err: Msgbox(ArrayLen(th()),"done") End Sub Sub Button2_Click 'save img dat If savedialog1.Show = cCancel Then Return name=savedialog1.File FileOpen(c1,name,cRandom) bin.New1(c1,True) bin.WriteBytes(th()) FileClose(c1) End Sub Sub Button3_Click 'send img dat y3=0 For y = 0 To 5 pos(0,y*8) Serial.Output("B") byt(0)=84 serial.Output2(byt()) For x = 0 To 83 errorlabel(errt) byt(0)=th(y3) serial.Output2(byt()) y3=y3+1 Next Next errt: msgbox(y3) End Sub Sub Button3_ClickWORKS For y = 0 To 5 pos(0,y*8) Serial.Output("B") byt(0)=84 serial.Output2(byt()) For x = 0 To 83 byt(0)=rw1(y,x) serial.Output2(byt()) Next Next End Sub Sub Button4_Click 'open img If opendialog1.Show = cCancel Then Return 'Msgbox(opendialog1.File) bm.New1(opendialog1.File) image1.Image=bm.Value End Sub Sub Button5_Click 'open img dat If opendialog1.Show = cCancel Then Return name = opendialog1.File FileOpen(c1,name,cRandom) bin.New1(c1,True) bin.ReadBytes(th(),504) FileClose(c1) End Sub Sub Button6_Click y1=0 For y= 0 To 47 Step 8 For x = 0 To 83 For a = 0 To 7 if bit.GetBit(th(y1),a) =true then bm.SetPixel(x,y+a,cblack) doevents image1.Image=bm.Value Next y1=y1+1 Next Next End Sub