Bitmap2

I´m trying to use bitmap2 but it does not work and no errors are shown in console this is the code

    private function drawBackground(dc as Dc) as Void {
        if (null != _offscreenBuffer) {
            if ( Graphics.Dc has :drawBitmap2 ){
            dc.drawBitmap2(0, 0, _offscreenBuffer, {:tintColor => mFgColor});
            }else{
            dc.drawBitmap(0, 0, _offscreenBuffer);
            }
        }
    }


and this is the bitmap.xml file I have also try automatic palette false and true

<resources>
    <bitmap id="Evertop" filename="drawables/Evertop.png">
        <palette disableTransparency="true">
			<color>000000</color>
            <color>AAAAAA</color>
            <color>555555</color>
        </palette>
    </bitmap>
    
    <bitmap id="Evertopd" filename="drawables/Evertopd.png">
        <palette disableTransparency="true">
			<color>000000</color>
            <color>AAAAAA</color>
            <color>555555</color>
            <color>AA0000</color>
        </palette>
    </bitmap>
</resources>


I don´t know if it works

  •       // Create scaled and positioned mountain icon
          var options = {
            :transform => new Graphics.AffineTransform(),
            // :tintColor => tintColor
          };
          
          // Scale the icon to a reasonable size (0.8x scale)
          var scale = 0.8;
          options[:transform].scale(scale, scale);
          
          // Position it in the upper left area of the view
          var iconX = self.cx - 75;
          var iconY = self.cy - 10;
          options[:transform].translate(iconX.toFloat(), iconY.toFloat());
          
          dc.drawBitmap2(0, 0, icon, options);

    This is from my code and it works well

  • I use this string and worked but color is not changing

    <bitmap id="icon" filename="myPicture.png"  packingFormat="png">

    and crashes if I use it with bitmap and not bitmap2

  • have you used drawBitmap2 with tintColor in options? the bright colors are tinted afterward.