B4A Library [B4X] BitmapCreator Effects

Discussion in 'Additional libraries, classes and official updates' started by Erel, May 30, 2018.

  1. Erel

    Erel Administrator Staff Member Licensed User

    BitmapCreatorEffects class includes all kinds of very simple to use image effects.
    The class is cross platform and compatible with B4J (v6.3+), B4A (v8.3+) and B4i (v5.0+).
    'Greyscale an image:
    Dim GreyImage As B4XBitmap = effects.GreyScale(ExistingBmp)
    'Blur an image:
    Dim BlurImage As B4XBitmap = effects.Blur(ExistingBmp)

    The attached examples demonstrate the various methods.

    BitmapCreatorEffects depends on XUI and BitmapCreator libraries.

    Note that all of the example code is implemented in a class that is shared between the three projects. This way we can get 99% code reuse.


    Version 1.31 -New FadeBorders effect. See post #9: https://www.b4x.com/android/forum/threads/b4x-bitmapcreator-effects.93608/#post-672188
    Version 1.21 - New ReplaceColor method.
    Version 1.20 - Added PieceSize to ImplodeAnimated and added FlipVertical and FlipHorizontal methods.
    Version 1.10 - Adds TransitionAnimated method to transition between two bitmaps.

    The latest version of BitmapCreatorClass is included in the B4J project. You should take it as-is and add to your project.
    The Example class from the B4J project can also be used in the other projects.

    Attached Files:

    Last edited: Jul 10, 2019
  2. LucaMs

    LucaMs Expert Licensed User

    I like especially ImplodeAnimated (and have to watch the code, I can not imagine how it is done :D).

  3. Erel

    Erel Administrator Staff Member Licensed User

    V1.10 released with TransitionAnimated:

    BPak, LucaMs and Star-Dust like this.
  4. LucaMs

    LucaMs Expert Licensed User

    Very complex.

    I would change:

    Public Sub ImplodeAnimated (Duration As Int, PieceSize As Int, Bmp As B4XBitmap, ImageView As B4XView) As ResumableSub
        Dim GroupSize As Int = PieceSize

    PieceSize: 30 - 5 - 1 :

    Last edited: May 30, 2018
  5. Erel

    Erel Administrator Staff Member Licensed User

    V1.20 released with the above change and Flip methods.
    LucaMs and Johan Hormaza like this.
  6. LucaMs

    LucaMs Expert Licensed User

    Two very small things (one of them is my fault... as always :p:()

    1) BitmapCreatorEffects was updated to v. 1.20 but there is stil this comment:
    'Version 1.10

    2) the variable GroupSize never changes its value; so you could refine the routine using the parameter directly.
    (I LOVE F7 + rename :))

    [Just two details because I was looking at the code to answer a question submitted by a member]
    Last edited: May 31, 2018
  7. Erel

    Erel Administrator Staff Member Licensed User

    1) I've uploaded a new zip with the correct version in the comment (the code is the same).

    2) This is not important.
    LucaMs likes this.
  8. Erel

    Erel Administrator Staff Member Licensed User

    V1.21 uploaded to first post. New ReplaceColor method:

  9. Erel

    Erel Administrator Staff Member Licensed User

    V1.31 released with FadeBorders effect:

    It softens the borders and makes the image embed in a nicer way.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice