BO Component

| Because every time saved brings money |

...

Save a lot of time with the BO Component DLL for VisualStudio.NET


The ideal function library for beginners and advanced Visual Basic users. Complex functions done with just one line of code. Get the newest version for Win10 and VS2019-VS2022.


BOProgressBar
BODrawProgress(panel, value, color1, color2, width, smooth, text)
BOProgressBar

Holiday calculation
BOGetHoliday(day, month, year) As String
BOGetHolidayA(date) As String
BOGetAllHolidays(year) As String()
BOGetEaster(year) As DateTime
BOGetBeginSummertime(year) As Date
BOGetBeginWintertime(year) As Date
BOGetMothersday(year) As Date

Encryption / decryption
BOEncrypt(sOriginal, sPassword) As String
BODecrypt(sOriginal, sPassword) As String

Special characters / file names
BORemoveSpecialCharacters(sSource) As String
BOCleanFilename(sFilename) As String

BOComponent licensing
BOSetLicense("")
BOGetLicense() AS String

BOColorScheme
BOGetColorScheme(index) As Color()
BOColorScheme

Download file and text from webserver
BODownloadFile(sLocalFilename, sRemoteURL) As String
BODownloadText(sRemoteURL) As String

Image processing
BOWatermark(bmp, sText ,cColor, iLocation)
BORotateImage(bmp, iAngle, bWhite) As Bitmap
BOZoomImage(bmp, dZoomFactor) As Bitmap
BOConvertImageFile(sourcefile, destinationfile, compressionlevel) As String
BOImageManipulation(bmp, iBrightness, iMode) As Bitmap
BOImageResize(bmp, iWidth, iHeight) As Bitmap
BOImageThumbnail(sSourceImage, sDestImage, iWidth, iHeight) As String
BOMergeImages(BackgroundImage, OverlayImage, TransparentColor) As Bitmap

ZIP compression
BOZipFolder(sSourceFolder, sZipFile) As String
BOUnzipFolder(sZipFile, sDestFolder) As String

DAIKIN air conditioning control   Smart Home DAIKIN
BODaikinSet(IP, Power, Mode, SwingMode, FanSpeed, Temp) As String
BODaikinGet(IP, Power, Mode, SwingMode, FanSpeed, Temp) As String
BODaikinGetSensors(IP, RoomTemp, OutsideTemp) As String

reMarkable line file processing V5   reMarkable 2
RMConvertRMtoBitmap(RMFile, c1, c2, c3, TemplateImage) As Image
RMConvertRMtoSVG(RMFile, SVGFile, c1, c2, c3, TemplateImage) As String
RMConvertRMtoImageFile(RMFile, ImageFile, c1, c2, c3, TemplateImage) As String

RMComponent licensing   reMarkable 2
RMSetLicense("")
RMGetLicense() AS String

BO Component

PRICING / FREE VERSION

Free trial!

Use this code before the first function call to activate the corresponding license. Depending on the namespace used, BOLicense or RMLicense must be called.:

BOSetLicense("") '// demo version with watermarks
BOSetLicense("524654-1346322") '// full version (example)

Start Free Trial

bocomponent.zip | File size: 1.650 kb | Last modified: 17.04.2021 / 923

BO Component

Version BO

Use 'bocomponent' namespace without restrictions in all your projects. Only one license required per developer.
Please integrate the trial version before purchasing. License with a one-year subscription.

1 developer license
EUR 119,00 excl. VAT

Add To Cart
BO Component

Version BO/RM

Use 'bocomponent' and 'rmcomponent' namespace without restrictions in all your projects. Only one license required per developer.
Please integrate the trial version before purchasing. License with a one-year subscription.

1 developer license
EUR 228,00 excl. VAT

Add To Cart
BO Component

CODE EXAMPLES

Before referencing types in the BOComponent namespace, you must add a reference to the BOComponent.dll. Copy the downloaded BOComponent.dll and BOComponent.XML file in a custom folder on your dev drive, then add the reference to your project using the Browse button in the Add Reference dialog.

BO Component code example

If you add the Imports BOComponent statement you dont need to type the namespace 'BOComponent.'.
BOGetEaster(dDate) '// with IMPORTS Statement
BOComponent.BOGetEaster(dDate) '// without IMPORTS Statement

BO Component code example


BOComponent namespace


BODrawProgress(panel, value, color1, color2, width, smooth, text)
Draws a round progress bar on a given panel with a gradient. Enter a percentage (0-100), two colors, bar width, value for smooth gradient and an additional text as parameters. Define the font in the panel. When using the second line of text, store at least font size 16 in the panel. Percentage = 0 resets the panel (clear).
BOComponent.BODrawProgress(Panel_Progressbar, 33, Color.Orangered, Color.Red, 8, 0, "download") '// Draws an orangered gradient Progressbar with 33% and bar width 8 and "download" in the second line
BOComponent.BODrawProgress(Panel_Progressbar, 70, , , , ,) '// Draws a Progressbar with default color (green), 70% and default bar width 4 and no second line
BOProgressBar

BOGetHoliday(day, month, year) As String
Returns the Western European (german) name of the public holiday from the given day, month and year as a string.
Dim SingleHoliday As String = BOGetHoliday(24, 12, 2022) '// Result: SingleHoliday = "Heiligabend"
Dim SingleHoliday As String = BOGetHoliday(1, 1, 2023) '// Result: SingleHoliday = "Neujahr"

BOGetHolidayA(date) As String
Returns the Western European (german) name of the public holiday from the given date as a string.
Dim dDate As Date = Date.Parse("13.05.2022")
Dim SingleHoliday As String = BOGetHolidayA(dDate) '// Result: SingleHoliday = "Christi Himmelfahrt"

BOGetAllHolidays(year) As String()
Returns all Western European (german) names of the holidays from the given year as a string collection. The function stores the public holidays per day of the year. Index 1 = 1st day (1st January) = "Neujahr", Index 6 = 6th day (6th January) = "Heiligen drei Könige" ... Empty string = no public holiday.
Dim HolidayCollection As String() = BOGetAllHolidays(2022)
'// The next example lines show the holidays in the debug window.
Dim StartDay As Date = Date.Parse("01.01.2022")
For i As Integer = 1 To HolidayCollection.Count - 1
  If HolidayCollection(i) <> "" Then
    debug.print (StartDay.AddDays(i - 1).ToString("dd. MM. yyyy") + " " + HolidayCollection(i))
  End If
Next i

BOGetEaster(year) As DateTime
BOGetBeginSummertime(year) As DateTime
BOGetBeginWintertime(year) As DateTime
BOGetMothersday(year) As DateTime
Returns the date of Easter Sunday, begin of summer, beginn of winter and Motherday.
Dim dDate As Date = BOGetEaster(2022)
'// Result: Date of EasterSunday 2022

BOGetColorScheme(index) As Color()
This function generates up to 80 different color combinations, each with 6 harmonizing colors. The index is from 0 - 79. The colors are provided via a color array.
Dim ColorScheme As Integer = 12
Dim Color() As Color = BOComponent.BOGetColorScheme(ColorScheme) '// Gets the color scheme with index 12.
Textbox1.BackColor = Color(0)
...
Textbox5.BackColor = Color(5)
BOColorScheme

BOEncrypt(sOriginal, sPassword) As String
BODecrypt(sOriginal, sPassword) As String
Encrypts and decrypts the specified text sOriginal with the phrase sPassword. AES encryption!
Dim encryptedText As String = BOEncrypt("This is a text", "my password 123")
'// Result: 'N9jGWeDh1KbJt73kVNDMlA=='
Dim readableText As String = BODecrypt("N9jGWeDh1KbJt73kVNDMlA==", "my password 123")
'// Result: 'This is a text'

BOWatermark(bmp, sText ,cColor, iLocation)
Draws a watermark with a defined color and location on an existing bitmap. 4th parameter "Location": "c", "t", "b", "center", "top", "bottom". The bitmap is referenced with ByRef. The transferred bitmap is modified immediately.
'// Example 1: create new bitmap and add watermark
Dim TmpBmP As New Bitmap(400, 400)
BOWatermark(TmpBmP, "Watermark text", Color.Black, "center")
'// Example 2: load image file in a PictureBox and add watermark and save as new image file
PictureBox1.Load("testimage.jpg")
BOWatermark(PictureBox1.Image, "Watermark text", Color.Black, "center")
PictureBox1.Image.Save("testimage_modified.jpg")

BORotateImage(bmp, iAngle, bWhite) As Bitmap
Rotates a bitmap by a specified angle. The angle specification is absolute between 0 and 360 degrees. The third parameter specifies whether the background should be white (true) or the image.
'// load image file into PictureBox1, rotate the image 90 degrees, copy into PictureBox2 and save as new image file
PictureBox1.Load("testimage.jpg")
PictureBox2.Image = BORotateImage(PictureBox1.Image, 90, true)
PictureBox2.Image.Save("testimage_modified.jpg")

BOZoomImage(bmp, dZoomFactor) As Bitmap
Zooms an image using a zoom factor. Factor 1 = no change / factor <1 = zoom in / factor> 1 = zoom out.
'// load image file into PictureBox1, zoom image out, copy into PictureBox2 and save as new image file
PictureBox1.Load("testimage.jpg")
PictureBox2.Image = BOZoomImage(PictureBox1.Image, 2)
PictureBox2.Image.Save("testimage_modified.jpg")

BOConvertImageFile(sourcefile, destinationfile, compressionlevel) As String
Converts an image from one format to another. JPEG compression quality can be specified between 1-100%. Supportet image formats/extensions: .jpg, .jpeg, .bmp, .gif, .png, .tiff, .exif, .ico, .icon, .wmf, .emf.
Dim Result As String
Result = BOConvertImageFile("testimage.gif", "testimage_modified.jpg", 100)
If Result <> "OK" then
  '// Result contains the error message
End if

BOImageManipulation(bmp, iBrightness, iMode) As Bitmap
Changes the brightness and color of an image. Brightness is applied to all iModes. Due to the performance, this function is not suitable for very large images.
Values for the parameter iMode:
0 = nothing (only the brightness is adjusted)
1 = grayscale | 2 = black-white | 3 = sepia | 4 = red | 5 = green | 6 = blue | 7 = grayscale more contrast
Values for the parameter iBrightness:
1 = no changes | 0.5 = 50% darker | 1.5 = 50% brighter (maximum 5.0)
'// load image file into PictureBox1, turn it into grayscale and lighten it up, copy it into PictureBox2 and save as new image file
PictureBox1.Load("testimage.jpg")
PictureBox2.Image = BOImageManipulation(PictureBox1.Image, 1.1, 1)
PictureBox2.Image.Save("testimage_modified.jpg")

BOImageResize(bmp, iWidth, iHeight) As Bitmap
Enlarges or reduces an image to the specified values. If only width or only height is specified, the missing value is calculated proportionally.
'// load image file into PictureBox1, enlarge it (100 pixel width), copy into PictureBox2 and save as new image file
PictureBox1.Load("testimage.jpg")
PictureBox2.Image = BOImageResize(PictureBox1.image, 100, 0)
PictureBox2.Image.Save("testimage_modified.jpg")

BOImageThumbnail(sSourceImage, sDestImage, iWidth, iHeight) As String
Generates a thumbnail from an image file in the specified size. JPEG is automatically compressed to 50% quality. PNG, GIF, BMP and TIFF are saved uncompressed.
'// Generates a thumbnail with a height of 100 pixels and saves it as a JPEG.
Dim Result As String = BOImageThumbnail("testimage.jpg", "testimage_thumb.jpg", 0, 100)
'// Result = "OK" or error message

BOMergeImages(BackgroundImage, OverlayImage, TransparentColor) As Bitmap
Combines two images (e.g. from a picturebox). The overlayimage should be transparent. An additional transparent color can be specified (default = 'white').
PictureBox1.Load("backgroundimage.png")
PictureBox2.Load("overlayimage.png")
PictureBox3.Image = BOComponent.BOMergeImages(PictureBox1.Image, PictureBox2.Image, "white")

BOZipFolder(sSourceFolder, sZipFile) As String
Compresses the specified folder into the specified zip file. Result: "OK " and the zip file size in kilobytes as string
Dim Result As String = BOComponent.BOZipFolder("e:\myfolder", "e:\testzipfile.zip")
If Result.Contains("OK") Then
  MessageBox.Show("File size: " + Result.Replace("OK ", ""))
End If

BOUnZipFolder(sZipFile, sDestinationFolder) As String
Unpacks the specified zip file into the specified folder. The folder will be recreated if it does not exist.
Dim Result As String = BOComponent.BOUnzipFolder("e:\testzipfile.zip", "e:\extracted")
If Result <> "OK" Then
  MessageBox.Show(Result) '// empty string = ok / or error message
End If


RMComponent / Daikin namespace


BODaikinSet(IP, Power, Mode, SwingMode, FanSpeed, Temp) As String Smart Home DAIKIN
Controls a DAIKIN air conditioning or heating device via the local network (configured WLAN module on the device required).

'// class constants
Daikin.FanSpeed
  .AUTO | .SILENT | .LEVEL_1 | .LEVEL_2 | .LEVEL_3 | .LEVEL_4 | .LEVEL_5

Daikin.PowerMode
  .DEVICE_ON | .DEVICE_OFF

Daikin.OperatingMode
  .AUTO | .COOLING< | .HEATING | .FAN | .DEHUMDIFICATOR

Daikin.SwingMode
  .STOPPED | .VERTICAL | .HORIZONTAL | .BOTH_DIRECTIONS

'// Example: Turn on, heating, horizontal swing, fan autospeed, 24 degrees celsius
Dim Result As String = BOComponent.BODaikinSet("192.168.0.191", Daikin.PowerMode.DEVICE_ON, Daikin.OperatingMode.HEATING, Daikin.SwingMode.HORIZONTAL, Daikin.FanSpeed.AUTO, 24)
'// Result = empty or error message

BODaikinGet(IP, Power, Mode, SwingMode, FanSpeed, Temp) As String Smart Home DAIKIN
Retrieves all parameters from the device. All variables (except IP-Address) are transferred via ByRef and contain the requested values after the function has ended.

'// class constants are the same as the previous function
Dim PowerMode, OperatingMode, SwingMode, FanSpeed, Temperature As Integer
Dim Result As String = BOComponent.BODaikinGet("192.168.0.191", PowerMode, OperatingMode, SwingMode, FanSpeed, Temperature)
If Result = "" then
  '// Example: the temperature set on the device:
  Messagebox.Show("Set temperature: " + Temperature.tostring + "°")
End If

BODaikinGetSensors(IP, RoomTemp, OutTemp) As String Smart Home DAIKIN
Receives the room temperature and outside temperature from the device sensors. All variables (except IP-Address) are transferred via ByRef and contain the requested values after the function has ended.

Dim RoomTemp, OutTemp As Integer
Dim Result As String = BOComponent.BODaikinGetSensors("192.168.0.191", RoomTemp, OutTemp)
If Result = "" then
  Messagebox.Show("Room temperature: " + RoomTemp.tostring + "°")
  Messagebox.Show("Outside temperature: " + OutTemp.tostring + "°")
End If


RMComponent namespace


RMConvertRMtoBitmap(RMFile, c1, c2, c3, TemplateImage) As Image reMarkable 2
Converts an .rm file to an image. The three colors (black, gray, marker color) can optionally be changed. Optionally, a template image can be mixed in. The result is returned as an image.
Dim RMFile As String ="0.rm"
PictureBox_RM.Image = RMComponent.RMConvertRMtoBitmap(RMFile, "black", "gray", "yellow", PictureBox_Template.Image)
'// Picturebox_RM contains the image created from the .rm file and the template in Picturebox_Template.

RMConvertRMtoSVG(RMFile, SVGFile, c1, c2, c3, TemplateImage) As String reMarkable 2
Converts an .rm file to a svg file. The three colors (black, gray, marker color) can optionally be changed. Optionally, a template image can be mixed in. The result is returned as an image.
Dim RMFile As String ="0.rm"
Dim svgfile As String ="0.svg"
Dim Result As String = RMComponent.RMConvertRMtoSVG(RMFile, svgfile, "black", "gray", "yellow", PictureBox_Template.Image)
'// Dim Result As String = RMComponent.RMConvertRMtoSVG(RMFile, svgfile) ' default without template image
If Result = "" Then
  Process.Start(svgfile)
Else
  MessageBox.Show(Result)
End If

RMConvertRMtoImageFile(RMFile, ImageFile, c1, c2, c3, TemplateImage) As String reMarkable 2
Converts an .rm file to an image file. The three colors (black, gray, marker color) can optionally be changed. Optionally, a template image can be mixed in. The result is returned as an image. The target file format depends on the file extension (jpg, bmp, png, gif, tiff).
Dim RMFile As String ="0.rm"
Dim ImageFile As String ="0.png"
Dim Result As String = RMComponent.RMConvertRMtoImageFile(RMFile, ImageFile, "black", "gray", "yellow", PictureBox_Template.Image)
'// Dim Result As String = RMComponent.RMConvertRMtoImageFile(RMFile, ImageFile) ' default without template image
If Result = "OK" Then
  Process.Start(ImageFile)
Else
  MessageBox.Show(Result)
End If

Notes on required permissions:
For security reasons, access to the Windows system folder for the image functions may be blocked, as admin rights are required. E.g. you cannot write directly to c: /test.jpg without admin rights. Solution: Start the application as an administrator.


Prevent memory overflow:
Before a new image is assigned to a Picturebox, the current image should be disposed. If this is not done, there will be a memory overflow at some point.
PictureBox2.Image.dispose() '// Releases the reserved memory
PictureBox2.Image = BOImageResize(PictureBox1.image, 100, 0)
Use the Visual Studio diagnostic tool to monitor the memory requirements of your application. The memory requirement should NOT increase with every graphic function (only for a short time). Repeat functions several times to test whether memory is released correctly.

BO Component


Demo application with VB.NET sample sourcecode:
The demo application including source code for using all functions of the BOComponent.dll is included in the download.

BO Component  RM Component  RM Component


Distributon of the bocomponent.dll:
To distribute our DLL, you just need to copy the bocomponent.dll into your application folder containing the EXE files. You dont need to install any license key on end-user PCs. The license information is sent to the DLL via code. BOSetLicense("LICENSE_KEY") or RMSetLicense("LICENSE_KEY")

WHO and WHY

Who is behind BO Component?
BO (bonit.at Software) & Component = BO Component

Roland

Passionate programmer. For 16 years in the software business with numerous applications. He develops with Visual Basic. NET outstanding products.

Our valued customers

We would be nothing without our customers who encourage us to develop new things every day and to exceed our limits.

BO Component

CONTACT


Our Address

bonit.at Software OG
Hans-Grünseis-Gasse 3
2700 Wiener Neustadt, Austria

click to view Terms & Conditions and Imprint
© bonit.at Software OG
  •            
  • visa credit card icon
  • mastercard credit card icon
  • paypal credit card icon
  •