title: get bitmap view's fragment without display
body: <p>As title of this question I want to get bitmap image of view fragment without display it on screen there are my codes</p>
  
  <pre><code>     public Bitmap getScreenShootViewPage(Context context,ViewGroup container){
  
          LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
          mSliderMovieDetailPages = new ArrayList&lt;SliderMovieDetailPages&gt;();
          mRootView = inflater.inflate(R.layout.fragment_screen_slide,container,false);
          mViewPager = (ViewPager)mRootView.findViewById(R.id.pager);
          mViewPager.setOffscreenPageLimit(3);
          mViewPager.setClipToPadding(false);
          mViewPager.setPageMargin((int) UtiliesFunctions.convertPixelsToDp(30, context));
          if(MainActivity.mHomeReponse!=null&amp;&amp;MainActivity.mHomeReponse.getRibbons().get(mCategoryPosition)!=null){
              for(int i=0;i&lt;activity.mHomeReponse.getRibbons().get(mCategoryPosition).getItems().size();i++){
                  mSliderMovieDetailPages.add(SliderMovieDetailPages.newInstance(activity.mHomeReponse.getRibbons().get(mCategoryPosition).getItems().get(i)));
              }
  
              mSliderMovieDetailAdapter = new SliderMovieDetailAdapter(getChildFragmentManager(),mSliderMovieDetailPages);
              mViewPager.setAdapter(mSliderMovieDetailAdapter);
              mViewPager.setCurrentItem(mItemPosition);
          }
         return UtiliesFunctions.loadBitmapFromView(mRootView);
      }
  </code></pre>
  
  <p>this is my loadBitmapFromView function </p>
  
  <pre><code>public static Bitmap loadBitmapFromView(View v) {
              Bitmap b = Bitmap.createBitmap(v.getMeasuredWidth(), v.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
              b.recycle();
              Canvas c = new Canvas(b);
              v.layout(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());
              v.draw(c);
              return b;
  
      }
  </code></pre>
  
  <p>I dont know why function v.getMeasuredWidth() alway return 0 please correct me. Thank alot!</p>