$Include "Rapidq2.inc" $Include "Rapidq.inc" '$RESOURCE LEDROFF as "D:\RapidQ\_Test_Qimage_BMP\image\LedRoff.bmp" '$RESOURCE LEDROn as "D:\RapidQ\_Test_Qimage_BMP\image\LedRon.bmp" '$RESOURCE ARRET as "D:\RapidQ\_Test_Qimage_BMP\image\ARRET.bmp" '$RESOURCE CONFORT  as "D:\RapidQ\_Test_Qimage_BMP\image\CONFORT.bmp" '$RESOURCE ECO  as "D:\RapidQ\_Test_Qimage_BMP\image\ECO.bmp" '$RESOURCE HGEL  as "D:\RapidQ\_Test_Qimage_BMP\image\HGEL.bmp" $Apptype GUI Application.Title = "Test Qimage et BMP" $TYPECHECK ON $OPTIMIZE ON $Include "inc\Minimize.inc" $option Icon "icon\mylogo.ICO" '$RESOURCE LEDROFF as "D:\RapidQ\_Test_Qimage_BMP\image\LedRoff.bmp" '$RESOURCE LEDROn as "D:\RapidQ\_Test_Qimage_BMP\image\LedRon.bmp" ' $include "inc\Form.inc" const Version="190119" dim j as integer dim c1$ dim D1$ declare sub Timer1Over() declare Sub Form1Show(Sender as QForm) declare Sub Form1Close(Action AS INTEGER) declare Sub Rafraichit_Icones Dim Images(6) as QImage Create Form1 as QFORM Caption = "Form1" Top = 583 Left = 276 Width = 497 Height = 350 OnShow = Form1Show OnClose = Form1Close BorderStyle = 1 DelBorderIcons = 2 Icon = "icon\mylogo.ico" End Create Create Image1_1 as QImage Parent = Form1 Top = 144 Left = 168 Width = 30 Height = 30 BMP = "image\LedRoff.bmp" ' BMPHandle =LEDROFF End Create Create Image1_2 as QImage Parent = Form1 Top =72 Left = 312 Width = 30 Height = 30 BMP = "image\Voyant_Arret.bmp" ' BMPHandle =LEDRON End Create Create Image1_3 as QImage Parent = Form1 Top = 112 Left = 312 Width = 30 Height = 30 BMP = "image\ARRET.bmp" Center = True End Create Create Image1_4 as QImage Parent = Form1 Top = 152 Left = 312 Width = 30 Height = 30 BMP = "image\ECO.bmp" Center = True End Create Create Image1_5 as QImage Parent = Form1 Top = 192 Left = 312 Width = 30 Height = 30 BMP = "image\CONFORT.bmp" Center = True End Create Create Image1_6 as QImage Parent = Form1 Top = 232 Left = 312 Width = 30 Height = 30 BMP = "image\HGEL.bmp" Center = True End Create Create Timer1 as QTimer Enabled = True Interval = 100 End Create Create Label1 as QLabel Parent = Form1 Top = 152 Left = 64 Width = 90 Height = 21 Caption = "J value" Color = &HF0F0F0 End Create Create Edit1_2 as QEdit Parent = Form1 Top = 96 Left = 48 Width = 129 Height = 21 Text = "SCEEH" Color = &HFFFFFF ' OnChange = Edit1_2Change End Create Create StatusBar1 as QStatusBar Parent = Form1 Top = 547 Left = 0 Width = 592 Height = 25 SimplePanel = True enabled=true SimpleText = "hello" End Create Create Label2_2 as QLabel Parent = Form1 Top = 200 Left = 48 Width = 132 Height = 29 Caption = "Label2_2" Color = &HF0F0F0 End Create '----- Win API Function Declarations 'DECLARE FUNCTION SetWindow LIB "user32" ALIAS "SetWindowLongA"(hwnd AS LONG, nIndex AS LONG, dwNewLong AS LONG) AS LONG ''----- SUBs 'Sub SetMinimize (Form as QForm) 'Allow RQ App to Minimize to Taskbar ' Setwindow(Form.Handle, -8, 0) ' Setwindow(Application.Handle, -8, Form.Handle) 'End Sub Sub Form1Show(Sender as QForm) Form1.caption="Test QImage et BMP "+version j=0 ' Image1_1.BMP = "D:\RapidQ\_Test_Qimage\image\LedRoff.bmp" ' Image1_1.BMPHandle = LEDROFF 'Image1_2.BMP = "D:\RapidQ\_Test_Qimage\image\LedRon.bmp" ' Image1_2.BMPHandle = LEDRONF Images(6).BMP = "D:\RapidQ\_BT_Edfinfo\_BMP\Voyant_Arret.bmp" Images(5).BMP= "D:\RapidQ\_BT_Edfinfo\_BMP\Voyant_Marche.bmp" Images(4).BMP= "D:\RapidQ\_BT_Edfinfo\_BMP\ARRET.bmp" Images(3).BMP= "D:\RapidQ\_BT_Edfinfo\_BMP\CONFORT.bmp" Images(2).BMP= "D:\RapidQ\_BT_Edfinfo\_BMP\ECO.bmp" Images(1).BMP= "D:\RapidQ\_BT_Edfinfo\_BMP\HGEL.bmp" Timer1.Interval=2000 Timer1.Enabled=True Label1.Caption="j=0" Timer1.OnTimer=Timer1Over End Sub Sub Form1Close(Action AS INTEGER) Application.terminate end sub Sub Rafraichit_Icones dim i as integer D1$=Edit1_2.Text Label2_2.Caption=D1$ for i=1 to len(d1$)-1 C1$=MID$(D1$,i,1) DoEvents next i C1$=MID$(D1$,1,1) select case C1$ case "M" image1_2.BMP="image\Voyant_Marche.bmp" case "S" image1_2.BMP="image\Voyant_Arret.bmp" end select C1$=MID$(D1$,2,1) select case C1$ case "A" image1_3.BMP="image\Arret.bmp" case "C" image1_3.BMP="image\Confort.bmp" case "E" image1_3.BMP="image\Eco.bmp" case "H" image1_3.BMP="image\HGel.bmp" end select C1$=MID$(D1$,3,1) select case C1$ case "A" image1_4.BMP="image\Arret.bmp" case "C" image1_4.BMP="image\Confort.bmp" case "E" image1_4.BMP="image\Eco.bmp" case "H" image1_4.BMP="image\HGel.bmp" end select C1$=MID$(D1$,4,1) select case C1$ case "A" image1_5.BMP="image\Arret.bmp" case "C" image1_5.BMP="image\Confort.bmp" case "E" image1_5.BMP="image\Eco.bmp" case "H" image1_5.BMP="image\HGel.bmp" end select C1$=MID$(D1$,5,1) select case C1$ case "A" image1_6.BMP="image\Arret.bmp" case "C" image1_6.BMP="image\Confort.bmp" case "E" image1_6.BMP="image\Eco.bmp" case "H" image1_6.BMP="image\HGel.bmp" end select end sub sub Timer1Over dim i as integer Statusbar1.simpletext="" D1$=Edit1_2.Text Label2_2.Caption=D1$ for i=1 to len(d1$)-1 C1$=MID$(D1$,i,1) StatusBar1.simpleText= D1$ DoEvents next i ' clignote 1ere led if (j AND &H0001) >0 then Image1_1.BMP="image\LedVon.bmp" Statusbar1.simpletext ="Rafraichit Led clignotante" else Image1_1.BMP="image\LedVoff.bmp" Statusbar1.simpletext ="Rafraichit etats graphiques" Rafraichit_Icones end if j=j+1 end sub SetMinimize(Form1) Form1.ShowModal