B4J Library [B4X] SD_ImageView

Discussion in 'B4J Libraries & Classes' started by Star-Dust, May 6, 2019.

  1. Star-Dust

    Star-Dust Expert Licensed User

    I created a custom ImageView view that allows you to upload an image from the web.
    Just pass the URL as a parameter
    This class is B4X but does not depend on the XUI library


    Author: Star-Dust
    Version: 0.02
    • SD_ImageView
      • Events:
        • LongClick
        • OneClick
      • Fields:
        • NatObject As ImageView
        • Zoom As ImageView
      • Functions:
        • BringToFront
        • DesignerCreateView (Base As Panel, Lbl As Label, Props As Map)
        • GetBase
        • Initialize (Callback As Object, EventName As String)
        • RemoveViewFromParent
        • RequestFocus
        • SendToBack
      • Properties:
        • Bitmap As Bitmap [write only]
        • Enable As Boolean [write only]
        • Gravity As Int [write only]
        • Height As Float [write only]
        • Left As Float [write only]
        • PreserveRatio As Boolean [write only]
        • Tag As Object [write only]
        • Top As Float [write only]
        • UrlBitmap As String [write only]
        • Visible As Boolean [write only]
        • Width As Float [write only]

    Sub Globals
    'These global variables will be redeclared each time the activity is created.
        'These variables can only be accessed from this module.
        Private SD_ImageView1 As SD_ImageView
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    End Sub

    Sub SD_ImageView1_OneClick
    End Sub

    Sub SD_ImageView1_LongClick
    End Sub

    Attached Files:

    Last edited: May 8, 2019
  2. Almora

    Almora Active Member Licensed User

    Can zoom feature be added?
  3. Star-Dust

    Star-Dust Expert Licensed User

    What kind of zoom do you want to get?
    Enlarge the view?
    Enlarge a coordinate from code?
    Enlarge with pinch to zoom?
    Last edited: May 7, 2019
  4. Almora

    Almora Active Member Licensed User

    As in webview
    pinch ti zoom
  5. Star-Dust

    Star-Dust Expert Licensed User

    It could be done, we'll see at the next update
    Almora and Johan Hormaza like this.
  6. Star-Dust

    Star-Dust Expert Licensed User

    Fixed a bugs in the manifest. Updated to post#1
    DonManfred, Erel and José J. Aguilar like this.
  7. Star-Dust

    Star-Dust Expert Licensed User

    Update rel 0.02
    Add Pinch to Zoom
    Gravity.FILL ' Only Android

    It's not perfect but it works. Besides, I can't do everything :p

    PS. Obviously it only works on Android and iOs the zoom and it doesn't work for desktop. There are no mice that click at two different points :D:D:D
    Last edited: May 8, 2019
    Peter Simpson, aeric, Erel and 4 others like this.
  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