MapMarker from a BufferedBitmap rather than a resource

Is there any way to use a Buffered Bitmap, rather than a resource, to set the icon for a MapMarker? I just want a range of different colored square and circle symbols and hate to create a bunch of icons just for that. Creating them at run time would be much cleaner here.
  • Former Member
    Former Member
    Currently, the only way to get access to the BitmapResource that backs a BufferedBitmap, is to initialize it from a BitmapResource.

    I think you could create a single resource that was a blank canvas and load it multiple times, initialize BufferedBitmaps from it, and then draw to that surface. I believe the VM will load a separate copy of your resource every time you call WatchUi.loadResource().
  • Brian, your a genius! Works like a charm.
    for(...)
    {
    var res = Ui.loadResource(Rez.Drawables.MarkerDkBlueDot);
    var bbm = new Gfx.BufferedBitmap(
    {
    :bitmapResource=>res
    });
    var dc = bbm.getDc();
    dc.setColor(tracker.clrDog(iDog),ClrTrans);
    if (sym == SymMoving)
    {
    dc.fillCircle(8,8,5);
    }
    else
    {
    dc.fillRectangle(2,2,12,12);
    }
    lst= res;
    }

    [/CODE]