B4XSnippetDrawing [B4X]
Bezier curve [B4X]
How to make the bezier curve with B4X? Here is a simple code, you can edit points by tapping and dragging them and the curve will change.
@Star-Dust · 2018-08-25
B4XSnippetColour [B4X]
Change the background alpha level [B4X]
Change the background alpha level [B4X]
@Erel · 2018-08-17
B4XSnippetImages [B4X][BITMAPCREATOR]
Change Color of Bitmap [B4X] [BitmapCreator]
With this snip, you can easy change a Bitmap/Icon Color.
@Alexander Stolte · 2018-07-27
B4XSnippetFile handling [B4X]
Automatically increment file names [B4X]
if you download a file with Google Chrome for example and you have you''ve already downloaded this one time, then a number will appear next to it. This is now easy possible with this peace of code.
@Alexander Stolte · 2018-07-17
B4XSnippetImages [B4X][BITMAPCREATOR]
Find Minimum Bounding Rectangle [B4X] [BitmapCreator]
Input: A Bitmap or B4XBitmap. Output: A rectangle with the boundaries of the non-transparent area.
@Erel · 2018-07-08
B4XSnippetFile handling
Check equality of two files
A way to compare two files
@fredo · 2018-06-27
B4XSnippetDrawing [B4X][XUI]
Faster* DrawPolygon Method [B4X] [XUI]
You can draw polygons with B4XCanvas.DrawPath. The following code calls B4XCanvas.DrawPath on B4A and B4i and calls a different method in B4J. DrawPath in B4J is slower than the other drawing methods as it requires clipping the canvas (it is only required in B4J). To summarize, only use this code if you encountered a performance issue with B4XCanvas.DrawPath in B4J.
@Erel · 2018-06-24
B4XSnippetImages [B4X]
Convert bitmap to BMP format [B4X]
Input: B4XBitmap / Bitmap / Image. Output: array of bytes with the BMP format.
@Erel · 2018-06-24
B4XSnippetB4R
Calculate Heat Index (B4x compatible)
I wanted to cycle between the actual air temperature and heat index on my little ESP-12E pool project. This can be used in any B4x IDE. It requires a known temperature and humidity. Calculating the heat index requires the temperature to be in Fahrenheit, so if working in Celsius, you need to convert it first: F = (C x 1.8) + 32. To convert Fahrenheit back to Celcius: C = (F - 32) / 1.8
@Kevin · 2018-06-17
B4XSnippetDrawing [B4X][XUI]
Canvas Draw Round Rect, Arcs, Ovals [B4X] [XUI]
XUI v1.60 introduces a new method: DrawPath. With this, now we have more options to draw: Arc, Oval, RoundRect, LineTo
@ivan.tellez · 2018-05-16
B4XSnippetImages [B4X][BITMAPCREATOR]
Blur Image [B4X] [BitmapCreator]
Returns a blurred image
@Erel · 2018-05-14
B4XSnippetDrawing [B4X][BITMAPCREATOR]
Draw radial gradients [B4X] [BitmapCreator]
Draw radial gradients [B4X] [BitmapCreator]
@Erel · 2018-05-10
B4XSnippetImages [B4X][XUI]
Light Effect B4A [B4X] [XUI]
Have you ever thought of making a lighting effect on an image? If you do not, I thought about it ... this is a small code with a simple trick that allows you to get it with B4X
@Star-Dust · 2018-05-01
B4XSnippetImages [B4X][XUI]
Light Effect [B4X] [XUI]
Have you ever thought of making a lighting effect on an image? If you do not, I thought about it ... this is a small code with a simple trick that allows you to get it with B4X
@Star-Dust · 2018-05-01
B4XSnippetStrings [B4X]
Integer to Word [B4X]
Convert an integer number to words (text)
@AHilton · 2018-04-28
B4XSnippetDrawing [B4X]
Cube Spline [B4X]
I made the B4X version for the Cube Spline. This is just an exercise, but can be used with appropriate modifications for other applications.
@Star-Dust · 2018-04-25
B4XSnippetAnimation [B4X][BITMAPCREATOR]
Layout implode animation [B4X] [BitmapCreator]
Layout implode animation [B4X] [BitmapCreator]
@Erel · 2018-04-22
B4XSnippetImages [B4X][XUI]
Image to JPEG byte array with resize/quality options [B4X] [XUI]
Image to JPEG byte array with resize/quality options [B4X] [XUI]
@OliverA · 2018-04-11
B4XSnippetImages [B4X]
Mandelbrot Fractal [B4X]
Mandelbrot Fractal [B4X]
@Erel · 2018-04-03
B4XSnippetB4X
FIFO queue
A FIFO queue (First-In-First-Out): Initialize - sets up the queue. isInitilized - true if initialized false if not push - add an item to the queue (Always to the end). pop - return the first item AND remove it from the queue. peek - return the first item but does not remove it size - returns the size (item count) in the queue toArray - returns ALL the items in the queue, but does not remove them.
@Daestrum · 2018-03-28
B4XSnippetFile handling [B4X]
Reading a UTF 8 file that might have BOM [B4X]
UTF8 text files might include a BOM character. You can test it by using a decent text editor such as Notepad++. Always prefer to work with text files encoded with UTF8 without BOM. This code reads a UTF8 text file and removes the BOM character if needed.
@Erel · 2018-03-22
B4XSnippetStrings
Remove leading numbers from string
This code removes leading numbers from a string
@fredo · 2018-03-06
B4XSnippetGPS/location/maps [B4X]
Find distance between two points (Lat/Lon) [B4X]
Here is a function that could be useful if you want to determine the distance between two coordinates. The distance is returned in Miles.
@Amin Ismail · 2018-02-28
B4XSnippetDate/time [B4X]
Convert milliseconds to string [B4X]
This code converts milliseconds to hours, minutes and seconds
@Erel · 2018-02-22
B4XSnippetB4X
Send structure from C++ to B4X in prefix mode
Send structure from C++ to B4X in prefix mode
@johnf2013 · 2018-02-10
B4XSnippetGPS/location/maps
Load Map - travel to site show start point and end point on google maps
Load Map – travel to site show start point and end point on google maps
@Daniel-White · 2018-02-09
B4XSnippetGPS/location/maps [B4X]
Google Street View Get Picture [B4X]
With this Code you can get the picture of a Google Street View Position
@Alexander Stolte · 2018-02-01
B4XSnippetGPS/location/maps [B4X]
Check if Google Street View is available [B4X]
This code check''s easy and fast if Google Street View is available. You need the latitude and longitude.
@Alexander Stolte · 2018-02-01
B4XSnippetB4X [B4X]
Do something after the user finished typing [B4X]
This code pattern allows you to do something after the user stopped typing. It can be useful for example if you want to filter a large list or send a http request.
@Erel · 2017-12-06
B4XSnippetB4X [B4X]
Join arrays of bytes [B4X]
Input = A list (or array of objects) with one or more arrays of bytes; Output = An array of bytes with the input data.
@Erel · 2017-12-03