/** * Creates a placemark attributes bundle containing a MIL-STD-2525 symbol using the specified modifiers and * attributes. The ImageSource bitmap is lazily created via an ImageSource.Bitmap factory. The call to the * factory's createBitmap method made when Placemark comes into view; it's also used to recreate the bitmap if the * resource was evicted from the WorldWind render resource cache. * * @param symbolCode The 15-character SIDC (symbol identification coding scheme) code. * @param modifiers The ModifierUnit (unit) or ModifierTG (tactical graphic) modifiers collection. May be null. * @param attributes The MilStdAttributes attributes collection. May be null. * * @return A new PlacemarkAttributes bundle representing the MIL-STD-2525 symbol. */ public static PlacemarkAttributes createPlacemarkAttributes(String symbolCode, SparseArray<String> modifiers, SparseArray<String> attributes) { PlacemarkAttributes placemarkAttributes = new PlacemarkAttributes(); // Create a BitmapFactory instance with the values needed to create and recreate the symbol's bitmap SymbolBitmapFactory factory = new SymbolBitmapFactory(symbolCode, modifiers, attributes, placemarkAttributes); placemarkAttributes.setImageSource(ImageSource.fromBitmapFactory(factory)); return placemarkAttributes; }
tile.setImageSource(ImageSource.fromBitmapFactory(bitmapFactory));
return fromBitmap((Bitmap) source); } else if (source instanceof ImageSource.BitmapFactory) { return fromBitmapFactory((ImageSource.BitmapFactory) source); } else if (source instanceof Integer) { // Android resource identifier, as generated by the aapt tool return fromResource((Integer) source);
protected boolean addImage() { // Create an image source with a unique factory instance. This pattern is used in order to force WorldWind to // allocate a new OpenGL texture object for each surface image from a single bitmap instance. ImageSource imageSource = ImageSource.fromBitmapFactory(new ImageSource.BitmapFactory() { @Override public Bitmap createBitmap() { return bitmap; } }); // Add the surface image to this test's layer. this.layer.addRenderable(new SurfaceImage(new Sector(this.sector), imageSource)); this.getWorldWindow().requestRedraw(); // Advance to the next surface image's location. if (this.sector.maxLongitude() < this.firstSector.minLongitude() + this.firstSector.deltaLongitude() * 20) { this.sector.set( this.sector.minLatitude(), this.sector.minLongitude() + this.sector.deltaLongitude() + 0.1, this.sector.deltaLatitude(), this.sector.deltaLongitude()); } else { this.sector.set( this.sector.minLatitude() + this.sector.deltaLatitude() + 0.1, this.firstSector.minLongitude(), this.sector.deltaLatitude(), this.sector.deltaLongitude()); } // Add another image after the configured delay. return this.handler.sendEmptyMessageDelayed(ADD_IMAGE, ADD_IMAGE_DELAY); }