B4A Library MaskedImageView v1.0.3

DonManfred

Expert
Licensed User
MIV
Version:
1.03
  • MaskedImageView
    Methods:
    • AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
      programmatically add view to a panel or activity
    • Initialize (pkg As String, EventName As String, mask As String)
      Initialize the MaskImageView
      A mask you set here cannot be changed at runtime
    • IsInitialized As Boolean
    • getMask (width As Int, height As Int, name As String) As Bitmap
    Properties:
    • Drawable As Drawable [read only]
    • ImageBitmap As Bitmap [write only]
      Set the image to show Masked

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim miv1 As MaskedImageView
End Sub
[..]
    miv4.Initialize(Application.PackageName,"miv","shape_heart")
    miv1.AddToParent(Activity,125dip,125dip,100dip,100dip)
    miv1.ImageBitmap = bmp
 

Attachments

cambopad

Active Member
Licensed User
Hi @DonManfred! Thanks for this library! I just tested it, and it works!

However, I have one more question. Does it support click and touch event?
 

Kwame Twum

Active Member
Licensed User
Hello @DonManfred and all, Please I'm finding it difficult working with my own .svgs... I created a couple of them but they don't work. I've attached a new one I created with Adobe Illustrator.
Could anyone guide me on how to create one or upload a similar one for me?

I also tried modifying the ones in the res folder, but when I do, they don't show in the app
NB. I'm running the downloaded sample.

My modified code:
B4X:
miv2.Initialize(Application.PackageName,"miv","hex")  'hex is the name of the .svg file I created
miv2.AddToParent(Activity,150dip,0dip,100dip,100dip)
miv2.ImageBitmap = bmp
2nd_image_not showing.jpg
 

Attachments

Last edited:
Top