Bug? Is this an Intellisense bug?

Discussion in 'Bugs & wishlist' started by agraham, Jul 18, 2019.

  1. agraham

    agraham Expert Licensed User

    Code:
    Dim b As Bitmap
    Dim i As ImageView
    b. 
    ' after typing the period I get the expected Intellisense
    i.Bitmap. ' after typing the period  I do not get any Intellisense
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    This is not a bug. The code is invalid so not all features will work.
     
  3. agraham

    agraham Expert Licensed User

    Ok. That code was simplistic to show Intellisense, not to actually execute. This code doesn't show Intellisense.
    Code:
    Dim i As ImageView
    i.Initialize(
    "")
    i.Gravity  = Gravity_Center
    Dim bmp As Bitmap = LoadBitmapResize(dirname, filename, i.Width, i.Height, True)
    i.Bitmap = bmp
    Dim pix As Int
    pix = bmp. 
    ' I could select GetPixel from the Intellisence shown here after typing period
    pix = i.Bitmap. ' no Intellisense shown here after typing period so I have to type GetPixel myself :(
    When I complete the code I get an unknown type error so I can see why the Intellisense doesn't show anything, but shouldn't this be valid code?
    Code:
    ...
    i.Bitmap = bmp
    Dim pix As Int
    pix = bmp.GetPixel(
    0,0' no problem
    pix = i.Bitmap.GetPixel(0,0' Unknown type: android.graphics.Bitmap
     
  4. LucaMs

    LucaMs Expert Licensed User

    No :D but you're right, that's a bug.

    It is strange that the type returned by GetType(i.Bitmap) is the right one, android.graphics.Bitmap.



    [The code is not correct because you don't add "i" to an Activity or Panel and because Gravity_Center should be Gravity.Center]
     
  5. agraham

    agraham Expert Licensed User

    I know quite well what code is correct and what is not thank you. After half a century of practice I am getting quite good at it !
     
  6. LucaMs

    LucaMs Expert Licensed User

    I know; I was just kidding, answering to your "question":
    :)


    The worst thing is that it is not a bug of the Intellisense.
    Another strange thing is that this code works, instead:
    Code:
    Dim b As Bitmap = i.Bitmap
    pix = b.GetPixel(
    0,0)
     
    agraham likes this.
  7. Erel

    Erel Administrator Staff Member Licensed User

    I understand. For historic reasons ImageView.GetBitmap returns an unwrapped Bitmap (android.graphic.Bitmap). So you cannot access its methods directly. You need to wrap it:
    Code:
    Dim b As Bitmap = i.Bitmap
     
    jimmyF and agraham like this.
Loading...
  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