Android Question BitmapExtended

Discussion in 'Android Questions' started by Firpas, Dec 10, 2013.

  1. Firpas

    Firpas Active Member Licensed User

    How to initialize as mutable a bitmap with config "RGB_565" createed with createbitmap2??

    Sub Process_Globals
    Dim btmpex As BitmapExtended

    Sub Activity_Create(FirstTime AsBoolean)
    If FirstTime Then btmpex.Initialize("")

    Sub BtnConvert_Click
    Dim Bmp1 AsBitmap = Img1.Bitmap
    Dim Bmp2 AsBitmap = btmpex.createBitmap2(Bmp1.Width, Bmp1.Height, "RGB_565")

    'This change the config from RGB_565 to ARGB_8888
    Bmp2.InitializeMutable(Bmp1.Width, Bmp1.Height)

    'Convert to Black and White
    For y = 0 To Bmp2.Height-1
    For x = 0 To Bmp2.Width-1
    If btmpex.getPixel(Bmp1, x, y) >= 0xFFDCDCDC Then
    btmpex.setPixel(Bmp2, x, y, Colors.White)
    btmpex.setPixel(Bmp2, x, y,
    End If
  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