Share your opinion
WIDGETS GAMBAS
GAMBAS 3 SOFTWARES
TUTORIALS
Library
|
gb.scanner - Use gb.scanner component
Use gb.Scan component gambas 3
Hi,
Today i propose to your an example to manage scanner in gambas 3. Result will be displayed in a picturebox A)probe of your scanner to owner of scanners, write this command line in linux terminal: scanimage -L you should see line as this: device 'brother4:bus3;dev3' B) create new gambas project create new application or open source code bellow. C) Here code of this example: Private myscan As Scanner Public Sub Button1_Click() Dim myimg As Image myimg = myscan.Scan() PictureBox1.Image = myimg End Public Sub Form_Open() Me.Center() myscan = New Scanner("brother4:bus3;dev3") End Public Sub binfo_Click() If myscan.IsAvailable() Then 'Test if scanner is online and available return one boolean Label1.Text = "scanner connected" Else Label1.Text = "Scanner not connected" Endif lname.Text = myscan.Name 'return our brother4:bus3;dev3 text lmodel.Text = myscan.Model 'return string model of your scanner lvendor.Text = myscan.Vendor 'return string vendor of your scanner ltype.Text = myscan.Type 'return string connection type of your scanner End Public Sub CheckBox1_Click() PictureBox1.Stretch = CheckBox1.Value End one remark : To create new scanner "myscan" in Form_open, i need to give name of my scanner. that's why i need to launch terminal with scanimage -L command. well, to start simple scan, write this command myscan.scan() result will be in picturebox. Thanks for your attention. Creation date : 05/12/2021 @ 19:09 Reactions to this article
| QUICK MENU
SEARCH
LANGUAGE
COMPONENTS
Other
LANGUAGE
Where, who?
VISITS
visitors visitors online ARCHIVES GAMBAS 1/2
|