VisualFBEditor - IDE for FreeBasic
Re: VisualFBEditor - IDE for FreeBasic
Thank you very much for your quick support.
-
- Posts: 793
- Joined: Jul 26, 2018 18:28
Re: VisualFBEditor - IDE for FreeBasic
May I ask is there any barcode related component/example in mff or VisualFBEditor?
-
- Posts: 793
- Joined: Jul 26, 2018 18:28
Re: VisualFBEditor - IDE for FreeBasic
Here is an example barcode:
Code: Select all
'#Region "Form"
#if defined(__FB_MAIN__) AndAlso Not defined(__MAIN_FILE__)
#define __MAIN_FILE__
#ifdef __FB_WIN32__
#cmdline "Form1.rc"
#endif
Const _MAIN_FILE_ = __FILE__
#endif
#include once "mff/Form.bi"
Using My.Sys.Forms
Type Form1Type Extends Form
Declare Sub Form_Paint(ByRef Sender As Control, ByRef Canvas As My.Sys.Drawing.Canvas)
Declare Constructor
End Type
Constructor Form1Type
#if _MAIN_FILE_ = __FILE__
With App
.CurLanguagePath = ExePath & "/Languages/"
.CurLanguage = .Language
End With
#endif
' Form1
With This
.Name = "Form1"
.Text = "Form1"
.Designer = @This
.OnPaint = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As Control, ByRef Canvas As My.Sys.Drawing.Canvas), @Form_Paint)
.SetBounds 0, 0, 799, 599
End With
End Constructor
Dim Shared Form1 As Form1Type
#if _MAIN_FILE_ = __FILE__
App.DarkMode = False
Form1.MainForm = True
Form1.Show
App.Run
#endif
'#End Region
Sub fb_barcode(ByRef Canvas As My.Sys.Drawing.Canvas, x_pos As Integer, y_pos As Integer, txt As String, img_h As Integer, col As ULong, mult As Integer)
Dim As String char(0 To 44) = {" ","$","%","*","+","-",".","/", _
"0","1","2","3","4","5","6","7","8","9", _
"A","B","C","D","E","F","G","H","I","J","K","L","M", _
"N","O","P","Q","R","S","T","U","V","W","X","Y","Z","_"}
Dim As UByte bars_data(0 To 44, 0 To 15) = {{1,0,0,0,1,1,1,0,1,0,1,1,1,0,1,0}, _
{1,0,0,0,1,0,0,0,1,0,0,0,1,0,1,0}, _
{1,0,1,0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,0,0,1,0}, _
{1,0,1,0,1,1,1,0,1,0,0,0,1,1,1,0}, _
{1,1,1,0,1,0,1,1,1,0,1,0,0,0,1,0}, _
{1,0,1,1,1,0,1,1,1,0,1,0,0,0,1,0}, _
{1,0,1,0,1,0,0,1,1,0,0,0,1,1,1,0}, _
{1,1,1,0,1,0,1,0,1,1,1,0,0,0,1,0}, _
{1,0,1,1,1,0,1,0,1,1,1,0,0,0,1,0}, _
{1,0,1,0,1,1,1,0,1,1,1,0,0,0,1,0}, _
{1,1,1,0,0,0,1,0,1,0,1,0,1,1,1,0}, _
{1,0,0,0,1,1,1,0,1,0,1,0,1,1,1,0}, _
{1,1,1,0,0,0,1,1,1,0,1,0,1,0,1,0}, _
{1,0,0,0,1,0,1,1,1,0,1,0,1,1,1,0}, _
{1,1,1,0,0,0,1,0,1,1,1,0,1,0,1,0}, _
{1,0,0,0,1,1,1,0,1,1,1,0,1,0,1,0}, _
{1,0,0,0,1,1,1,0,1,0,1,1,1,0,1,0}}
Dim As Integer i, j, x, y, z, img_w = (16 * mult)
Dim As String txt_str = "*" + UCase(txt) + "*"
If mult < 1 Then
mult = 1
End If
img_h *= mult
For y = 1 To Len(txt_str)
For x = 0 To 44
If char(x) = Mid(txt_str, y, 1) Then
If mult > 1 Then
j = 0
For z = 0 To 15
If bars_data(x, z) = 1 Then
For i = 1 To mult
Canvas.Line x_pos + ((y - 1) * img_w) + (z + j), y_pos + 0, x_pos + ((y - 1) * img_w) + z + j, y_pos + img_h - 1, col
j += 1
Next i
j -= 1
Else
j += (mult - 1)
End If
Next z
Else
For z = 0 To 15
If bars_data(x, z) = 1 Then
Canvas.Line x_pos + ((y - 1) * img_w) + (z + j), y_pos + 0, x_pos + ((y - 1) * img_w) + z + j, y_pos + img_h - 1, col
End If
Next z
End If
End If
Next x
Next y
End Sub
Private Sub Form1Type.Form_Paint(ByRef Sender As Control, ByRef Canvas As My.Sys.Drawing.Canvas)
fb_barcode(Canvas, 10, 10, "freebasic", 34, BGR(0, 0, 0), 1)
fb_barcode(Canvas, 10, 60, "freebasic", 34, BGR(0, 0, 0), 2)
fb_barcode(Canvas, 10, 155, "freebasic", 34, BGR(0, 0, 0), 3)
fb_barcode(Canvas, 10, 280, "freebasic", 34, BGR(0, 0, 0), 4)
End Sub
Re: VisualFBEditor - IDE for FreeBasic
Here are the URLs of some commonly used barcode recognition libraries.
ZBar:https://github.com/mchehab/zbar
ZXing:https://github.com/zxing/zxing
ZBar:https://github.com/mchehab/zbar
ZXing:https://github.com/zxing/zxing
-
- Posts: 793
- Joined: Jul 26, 2018 18:28
Re: VisualFBEditor - IDE for FreeBasic
This topic also has a barcode reader:
https://freebasic.net/forum/viewtopic.php?p=171446
https://freebasic.net/forum/viewtopic.php?p=171446
Re: VisualFBEditor - IDE for FreeBasic
Thank you both very much!
Re: VisualFBEditor - IDE for FreeBasic
Just noticed VFBeditor has a 'use->wasm' option,may I also ask is there a simple example to learn wasm in FreeBasic?Thanks again.
-
- Posts: 793
- Joined: Jul 26, 2018 18:28
Re: VisualFBEditor - IDE for FreeBasic
Re: VisualFBEditor - IDE for FreeBasic
Thank you for the information!Xusinboy Bekchanov wrote: ↑Apr 28, 2024 6:26You can look at this example:
https://github.com/XusinboyBekchanov/Vi ... ebPage.frm