HelloLinkon
HelloLinkon

Reputation: 348

Unable to create image from vector object via com.sun.lwuit.image.createimage

Here is my code. I'm not able to create image from this vector object.

Hashtable metaData = new Hashtable();

Vector Ad = IADView.getBannerAdData(LwuitAd.this, "MyCompany_MyApp", metaData);
Object retImg = null;

if (null != Ad) {
    retImg = Ad.elementAt(0);
}

if (retImg != null) {
    com.sun.lwuit.Image img = com.sun.lwuit.Image.createImage(Ad.elementAt(0));// it shows error in this line
    Button buttonAd = new Button();
    buttonAd.setIcon(img);
    f.addComponent(BorderLayout.NORTH, buttonAd);
    f.show();
} else {
    System.out.println("retImg is null");
}

Upvotes: 1

Views: 81

Answers (1)

Racy Gomes
Racy Gomes

Reputation: 58

Use the classes to extract the image from IADView of Inneractive

https://projects.developer.nokia.com/JMEWeatherApp/browser/jmeweatherapp/src/com/nokia/example/weatherapp/ads?rev=b5af8939ab6a9bb084c56ff898989534a06afc38&order=name

You can also have a look at its implementation on the Nokia Weather Project

Cheers

Upvotes: 2

Related Questions