1. Download our Official Android App: Forums for Android!

Load img tag

Discussion in 'Android Help' started by Android Question, Dec 19, 2013.

  1. Android Question

    Thread Starter
    Rank:
    None
    Posts:
    0
    Joined:

    i have this html tag in my xml file "<img width="328" height="47" align="bottom" alt="mc001-2.jpg" src="@@PLUGINFILE@@/mc001-2.jpg" border="0">" and src attribute contain file name which if in another tag which is given below..

    <file name="mc001-2.jpg" encoding="base64"> /9j/4AAQSkZJRgABAAEAIwAUAAD//gAfTEVBRCBUZWNobm9sb2dpZXMgSW5jLiBWMS4wMQD/2wCE
    AAICAgICAgICAgICAgICAgICAgICAgICAgICAwMDAwMDAwMDBAUEAwQFBAMDBAYEBQUFBgYGAwQG
    BwYGBwUGBgUBAgICAgICAgICAgUDAwMFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUF
    BQUFBQUFBQUFBQUFBQUFBf/EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCwEAAwEBAQEB
    AQEBAQAAAAAAAAECAwQFBgcICQoLEAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEU
    MoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2Rl
    ZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK
    0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+foRAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYS
    QVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNU
    VVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5
    usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/AABEIABAACwMBEQACEQEDEQH/
    2gAMAwEAAhEDEQA/AP2M8S/Gm08Ba5f+HfG2g39nqWo3Gz4YQ6Jv1hvig7ou3SdMBSIQa1E+8z2M
    zKiWym9E7W8V09pNH2lem6VCnz4yDlzUbqP7vmfLXU3p9XjHlVeo0nh6l4zjy1MPOvcoxpTVSrNU
    8I1H987tQnyrmpTjFOXtJSv9XhFSeIi1GnerGpTh6x4fn1u60XTbnxHp1lpGuT2sc2p6Xp2oPqtn
    p1y/zG3jvHhhNzsBCmTy0DMGIGME7VIwhPkp1OdRSXNZpOVlzOKeqjzX5ea0uW3Mk7pYwlKScnTc
    LuXLFtcyjzPk5+VuKnycvOoylFTuoylFKT801v4LeHvF+ra9rfji7vPEmp3gW18KXCltKf4cadE8
    M8B8NvA5ew1H7TBFdy6srfaJZIoVysMMUKYU4zoU1KjVdPFc7m68bc+jkqcIqSlFUYwk4TotSp1+
    ao66qRnyR2qTVVxp1KalhoxS9i78km4pTqVGmnKo5X9nNOMsPDlVDkqe0q1fTdBstS03RtNsNY1h
    9f1OytIra81uWyt9On1SWMbftMtvb/uYpXADOIwqFixVEUhF3qzjUm5xpKne14xvyp2XNyqTlJR5
    ruMXKTjG0XKTXM8KUHSh7N1HNRbs5W5uW75VJpJSko2UpKMVJpy5Y35V/9k=
    </file>

    my problem is how to load image tag in webView with its src attribute?????????


    Any help would be highly appreciated.
     

    Advertisement

  2. Rukbat

    Rukbat Extreme Android User
    Rank:
    None
    Points:
    943
    Posts:
    10,392
    Joined:
    Jan 16, 2012

    Jan 16, 2012
    10,392
    2,897
    943
    Male
    Being retired and writing Tasker tasks.
    Fayetteville, NC, USA
    Decode the block first, and save it as a jpg file. Then you're working with what you want to be working with, an image file. A base64-encoding isn't a picture, it's a block of text. Then just change the img tag to

    <img width="328" height="47" align="bottom" alt="mc001-2.jpg" src="mc001-2.jpg" border="0">

    You might also want to load the decoded jpg file into an editor (Photoshop or whatever you use) and make it 328 wide by 47 high and save it that way. Then, of course, take the with and height attributes out of the tag. Resizing by telling a browser what size you want sometimes results in VERY strange-looking graphics (or garbage).
     
    scary alien likes this.

Share This Page

Loading...