May 30, 2018 Replies: 42 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+). Example: Code: '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. Updates v1.40 - Adds support for B4XImageViews (XUI Views). - New ScaleDownImages flag. True by default. The updated example demonstrates the usage. Note that if not using B4XImageView then you should set the image when ScaleDown = False, with XUIViewsUtils.SetBitmapAndFill. v1.31 -New FadeBorders effect. See post #9: https://www.b4x.com/android/forum/threads/b4x-bitmapcreator-effects.93608/#post-672188 v1.21 - New ReplaceColor method. v1.20 - Added PieceSize to ImplodeAnimated and added FlipVertical and FlipHorizontal methods. v1.10 - Adds TransitionAnimated method to transition between two bitmaps. Attachments EffectsExample.zip EffectsExample.zip 376.6 KB · Views: 2,064 B4XBitmapEffects.b4xlib B4XBitmapEffects.b4xlib 3.3 KB · Views: 2,052 Last edited: Apr 29, 2021 Click to expand...
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+). Example: Code: '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. Updates v1.40 - Adds support for B4XImageViews (XUI Views). - New ScaleDownImages flag. True by default. The updated example demonstrates the usage. Note that if not using B4XImageView then you should set the image when ScaleDown = False, with XUIViewsUtils.SetBitmapAndFill. v1.31 -New FadeBorders effect. See post #9: https://www.b4x.com/android/forum/threads/b4x-bitmapcreator-effects.93608/#post-672188 v1.21 - New ReplaceColor method. v1.20 - Added PieceSize to ImplodeAnimated and added FlipVertical and FlipHorizontal methods. v1.10 - Adds TransitionAnimated method to transition between two bitmaps.
LucaMs Expert Licensed User Longtime User May 30, 2018 #2 I like especially ImplodeAnimated (and have to watch the code, I can not imagine how it is done ). Also, Erel said: The class is cross platform and compatible with B4J (v6.3+), B4A (v8.3+) and B4i (v5.0+). Click to expand... Great!
I like especially ImplodeAnimated (and have to watch the code, I can not imagine how it is done ). Also, Erel said: The class is cross platform and compatible with B4J (v6.3+), B4A (v8.3+) and B4i (v5.0+). Click to expand... Great!
Erel B4X founder Staff member Licensed User Longtime User May 30, 2018 #3 V1.10 released with TransitionAnimated:
LucaMs Expert Licensed User Longtime User May 30, 2018 #4 LucaMs said: I like especially ImplodeAnimated (and have to watch the code, I can not imagine how it is done ). Click to expand... Very complex. I would change: Code: 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
LucaMs said: I like especially ImplodeAnimated (and have to watch the code, I can not imagine how it is done ). Click to expand... Very complex. I would change: Code: 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 :
Erel B4X founder Staff member Licensed User Longtime User May 30, 2018 #5 V1.20 released with the above change and Flip methods.
LucaMs Expert Licensed User Longtime User May 31, 2018 #6 Two very small things (one of them is my fault... as always ) 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. LucaMs said: Public Sub ImplodeAnimated (Duration As Int, PieceSize As Int, Bmp As B4XBitmap, ImageView As B4XView) As ResumableSub '... Dim GroupSize As Int = PieceSize Click to expand... (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
Two very small things (one of them is my fault... as always ) 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. LucaMs said: Public Sub ImplodeAnimated (Duration As Int, PieceSize As Int, Bmp As B4XBitmap, ImageView As B4XView) As ResumableSub '... Dim GroupSize As Int = PieceSize Click to expand... (I LOVE F7 + rename ) [Just two details because I was looking at the code to answer a question submitted by a member]
Erel B4X founder Staff member Licensed User Longtime User May 31, 2018 #7 LucaMs said: BitmapCreatorEffects was updated to v. 1.20 but there is stil this comment: Click to expand... 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 said: BitmapCreatorEffects was updated to v. 1.20 but there is stil this comment: Click to expand... 1) I've uploaded a new zip with the correct version in the comment (the code is the same). 2) This is not important.
Erel B4X founder Staff member Licensed User Longtime User Sep 12, 2018 #8 V1.21 uploaded to first post. New ReplaceColor method:
Erel B4X founder Staff member Licensed User Longtime User Jul 10, 2019 #9 V1.31 released with FadeBorders effect: It softens the borders and makes the image embed in a nicer way.
V1.31 released with FadeBorders effect: It softens the borders and makes the image embed in a nicer way.
LucaMs Expert Licensed User Longtime User Dec 10, 2019 #10 Why not a b4xlib? It is just a single class, I know, but... for example the projects attached to the first post have different versions of BitmapCreatorEffects class; using a b4x lib...! Attachments B4XBitmapEffects.b4xlib B4XBitmapEffects.b4xlib 3.6 KB · Views: 1,336
Why not a b4xlib? It is just a single class, I know, but... for example the projects attached to the first post have different versions of BitmapCreatorEffects class; using a b4x lib...!
Erel B4X founder Staff member Licensed User Longtime User Dec 11, 2019 #11 Both options are good in this case. Why distribute as a class? 1. It was written before b4xlib feature was available. 2. It is a single class which makes it easy to add to your project. 3. It is quite simple to extend it with new features as it is a collection of very specific subs.
Both options are good in this case. Why distribute as a class? 1. It was written before b4xlib feature was available. 2. It is a single class which makes it easy to add to your project. 3. It is quite simple to extend it with new features as it is a collection of very specific subs.
LucaMs Expert Licensed User Longtime User Dec 11, 2019 #12 Erel said: 1. It was written before b4xlib feature was available. Click to expand... I know, of course Erel said: 2. It is a single class which makes it easy to add to your project. Click to expand... It is much easier to "import" (select) a library; moreover, it is a common bad abitude for many of us... having to search in which project we have used a certain class (that is, not organizing our "tools" well) Erel said: 3. It is quite simple to extend it with new features as it is a collection of very specific subs. Click to expand... You probably don't know it but a b4xlib library contains the source code The main reason is the first; that's why I wanted to create the library, so you can simply attach it to the first post.
Erel said: 1. It was written before b4xlib feature was available. Click to expand... I know, of course Erel said: 2. It is a single class which makes it easy to add to your project. Click to expand... It is much easier to "import" (select) a library; moreover, it is a common bad abitude for many of us... having to search in which project we have used a certain class (that is, not organizing our "tools" well) Erel said: 3. It is quite simple to extend it with new features as it is a collection of very specific subs. Click to expand... You probably don't know it but a b4xlib library contains the source code The main reason is the first; that's why I wanted to create the library, so you can simply attach it to the first post.
Erel B4X founder Staff member Licensed User Longtime User Dec 11, 2019 #13 Done. Note that you don't need to add the empty folders.
LucaMs Expert Licensed User Longtime User Dec 11, 2019 #14 Erel said: Note that you don't need to add the empty folders. Click to expand... Useful info
AnandGupta Expert Licensed User Longtime User Dec 11, 2019 #15 I learnt something good today. Thanks to LucaMs. How to make a class into b4xlib. I will study the codes and try same in future. Regards, Anand
I learnt something good today. Thanks to LucaMs. How to make a class into b4xlib. I will study the codes and try same in future. Regards, Anand
LucaMs Expert Licensed User Longtime User Dec 11, 2019 #16 AnandGupta said: I will study the codes and try same in future. Click to expand... On site there are many much better examples of this, from which to learn https://www.b4x.com/android/forum/threads/new-feature-b4x-lib-a-new-type-of-library.100383/ Thank you, Anand. Last edited: Dec 11, 2019
AnandGupta said: I will study the codes and try same in future. Click to expand... On site there are many much better examples of this, from which to learn https://www.b4x.com/android/forum/threads/new-feature-b4x-lib-a-new-type-of-library.100383/ Thank you, Anand.
AnandGupta Expert Licensed User Longtime User Dec 11, 2019 #17 LucaMs said: On site there are many much better examples of this, from which to learn https://www.b4x.com/android/forum/threads/new-feature-b4x-lib-a-new-type-of-library.100383/ Thank you, Anand. Click to expand... I meant to say, Now I have both "class" and "b4xlib" codes for same logic and this will help me learn faster by comparing the changes require for the conversion Regards, Anand
LucaMs said: On site there are many much better examples of this, from which to learn https://www.b4x.com/android/forum/threads/new-feature-b4x-lib-a-new-type-of-library.100383/ Thank you, Anand. Click to expand... I meant to say, Now I have both "class" and "b4xlib" codes for same logic and this will help me learn faster by comparing the changes require for the conversion Regards, Anand
MarcoRome Expert Licensed User Longtime User Feb 18, 2020 #18 Hi Erel / All in first post the B4XBitmapEffects.b4xlib is 1.00 Where's is 1.31 ? Thank you Marco
MarcoRome Expert Licensed User Longtime User Feb 18, 2020 #19 MarcoRome said: Hi Erel / All in first post the B4XBitmapEffects.b4xlib is 1.00 View attachment 88829 Where's is 1.31 ? Thank you Marco Click to expand... Is Rel. 1.00 but with all effect
MarcoRome said: Hi Erel / All in first post the B4XBitmapEffects.b4xlib is 1.00 View attachment 88829 Where's is 1.31 ? Thank you Marco Click to expand... Is Rel. 1.00 but with all effect
Jorge M A Well-Known Member Licensed User Longtime User Feb 18, 2020 #20 MarcoRome said: Where's is 1.31 ? Click to expand... mmm! It seems that version 1.31 refers only to the .bas class Missed updating the manifest... [CODE lang="b4x" title="BitmapCreatorEffects.bas"]'Version 1.31[/CODE]
MarcoRome said: Where's is 1.31 ? Click to expand... mmm! It seems that version 1.31 refers only to the .bas class Missed updating the manifest... [CODE lang="b4x" title="BitmapCreatorEffects.bas"]'Version 1.31[/CODE]