public /* override */ virtual Bitmap OnLoadBitmap() { BitmapFactory.Options decodeOptions = new BitmapFactory.Options(); decodeOptions.InPreferredConfig = Config.Argb8888; // decodeOptions.InScaled = false; // TODO Check how this behaves with drawable-""/nodpi/ldpi/mdpi/hdpi folders return(BitmapFactory.DecodeResource(this.mContext.Resources, this.mDrawableResourceID, decodeOptions)); }
// =========================================================== // Constructors // =========================================================== public ResourceTextureSource(Context pContext, int pDrawableResourceID) { this.mContext = pContext; this.mDrawableResourceID = pDrawableResourceID; BitmapFactory.Options decodeOptions = new BitmapFactory.Options(); decodeOptions.InJustDecodeBounds = true; // decodeOptions.inScaled = false; // TODO Check how this behaves with drawable-""/nodpi/ldpi/mdpi/hdpi folders BitmapFactory.DecodeResource(pContext.Resources, pDrawableResourceID, decodeOptions); this.mWidth = decodeOptions.OutWidth; this.mHeight = decodeOptions.OutHeight; }