android.graphics.Movie.height()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中android.graphics.Movie.height()方法的一些代码示例,展示了Movie.height()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Movie.height()方法的具体详情如下:
包路径:android.graphics.Movie
类名称:Movie
方法名:height

Movie.height介绍

暂无

代码示例

代码示例来源:origin: square/assertj-android

public MovieAssert hasHeight(int height) {
 isNotNull();
 int actualHeight = actual.height();
 assertThat(actualHeight) //
   .overridingErrorMessage("Expected height <%s> but was <%s>.", height, actualHeight) //
   .isEqualTo(height);
 return this;
}

代码示例来源:origin: Rajawali/Rajawali

private void loadGIF() {
  Context context = TextureManager.getInstance().getContext();
  mMovie = Movie.decodeStream(context.getResources().openRawResource(mResourceId));
  mWidth = mMovie.width();
  mHeight = mMovie.height();
  
  mGIFBitmap = Bitmap.createBitmap(mWidth, mHeight, Config.ARGB_8888);
  mCanvas = new Canvas(mGIFBitmap);
  mMovie.draw(mCanvas, 0, 0);
  mBitmap = Bitmap.createScaledBitmap(mGIFBitmap, mTextureSize, mTextureSize, false);
}

代码示例来源:origin: Cutta/GifView

int movieHeight = movie.height();

代码示例来源:origin: huxq17/XRefreshView

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  if (mMovie != null) {
    int movieWidth = mMovie.width();
    int movieHeight = mMovie.height();
    int maximumWidth = MeasureSpec.getSize(widthMeasureSpec);
    float scaleW = (float) movieWidth / (float) maximumWidth;
    mScale = 1f / scaleW;
    mMeasuredMovieWidth = maximumWidth;
    mMeasuredMovieHeight = (int) (movieHeight * mScale);
    setMeasuredDimension(mMeasuredMovieWidth, mMeasuredMovieHeight);
  } else {
    setMeasuredDimension(getSuggestedMinimumWidth(), getSuggestedMinimumHeight());
  }
}

代码示例来源:origin: com.squareup.assertj/assertj-android

public MovieAssert hasHeight(int height) {
 isNotNull();
 int actualHeight = actual.height();
 assertThat(actualHeight) //
   .overridingErrorMessage("Expected height <%s> but was <%s>.", height, actualHeight) //
   .isEqualTo(height);
 return this;
}

代码示例来源:origin: cxMax/FloatingView

if (movie.width() <= 0 || movie.height() <= 0) {
  return;
  bitmap = null;
bitmap = Bitmap.createBitmap(movie.width(), movie.height(), Bitmap.Config.RGB_565);
canvas = new Canvas(bitmap);
handler.post(runnable);

代码示例来源:origin: pondurii/vrVideo

private void loadGIF() {
  Context context = TextureManager.getInstance().getContext();
  mMovie = Movie.decodeStream(context.getResources().openRawResource(mResourceId));
  mWidth = mMovie.width();
  mHeight = mMovie.height();
  
  mGIFBitmap = Bitmap.createBitmap(mWidth, mHeight, Config.ARGB_8888);
  mCanvas = new Canvas(mGIFBitmap);
  mMovie.draw(mCanvas, 0, 0);
  mBitmap = Bitmap.createScaledBitmap(mGIFBitmap, mTextureSize, mTextureSize, false);
}

代码示例来源:origin: renjianan/GifView

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  int widthMode = MeasureSpec.getMode(widthMeasureSpec);
  int heightMode = MeasureSpec.getMode(heightMeasureSpec);
  int sizeWidth = MeasureSpec.getSize(widthMeasureSpec);
  int sizeHeight = MeasureSpec.getSize(heightMeasureSpec);
  if (movie != null) {
    int movieWidth = movie.width();
    int movieHeight = movie.height();
    if (widthMode == MeasureSpec.EXACTLY) {
      mScaleW = ((float) movieWidth) / sizeWidth;
    }
    if (heightMode == MeasureSpec.EXACTLY) {
      mScaleH = ((float) movieHeight) / sizeHeight;
    }
    mScale = Math.max(mScaleW, mScaleH);
    setMeasuredDimension((widthMode == MeasureSpec.EXACTLY) ? sizeWidth
        : movieWidth, (heightMode == MeasureSpec.EXACTLY) ? sizeHeight
        : movieHeight);
  } else {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  }
}

代码示例来源:origin: JackWHLiu/jackknife

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  int width = 0;
  int height = 0;
  try {
    InputStream inputStream = getContext().getAssets().open(path);
    mMovie = Movie.decodeStream(inputStream);
    width = mMovie.width();
    height = mMovie.height();
    mHandler.post(r);
  } catch(IOException e) {
    e.printStackTrace();
  }
  setMeasuredDimension((int)(width*zoom),(int)(height*zoom));
}

代码示例来源:origin: qiubiteme/android_api_demos

@Override
  protected void onDraw(Canvas canvas) {
    canvas.drawColor(0xFFCCCCCC);
    Paint p = new Paint();
    p.setAntiAlias(true);
    canvas.drawBitmap(mBitmap, 10, 10, null);
    canvas.drawBitmap(mBitmap2, 10, 170, null);
    canvas.drawBitmap(mBitmap3, 110, 170, null);
    canvas.drawBitmap(mBitmap4, 210, 170, null);
    mDrawable.draw(canvas);
    long now = android.os.SystemClock.uptimeMillis();
    if (mMovieStart == 0) {   // first time
      mMovieStart = now;
    }
    if (mMovie != null) {
      int dur = mMovie.duration();
      if (dur == 0) {
        dur = 1000;
      }
      int relTime = (int)((now - mMovieStart) % dur);
      mMovie.setTime(relTime);
      mMovie.draw(canvas, getWidth() - mMovie.width(),
            getHeight() - mMovie.height());
      invalidate();
    }
  }
}

代码示例来源:origin: andforce/iBeebo

mGifh = mMovie.height();

代码示例来源:origin: THEONE10211024/ApiDemos

@Override
  protected void onDraw(Canvas canvas) {
    canvas.drawColor(0xFFCCCCCC);
    Paint p = new Paint();
    p.setAntiAlias(true);
    canvas.drawBitmap(mBitmap, 10, 10, null);
    canvas.drawBitmap(mBitmap2, 10, 170, null);
    canvas.drawBitmap(mBitmap3, 110, 170, null);
    canvas.drawBitmap(mBitmap4, 210, 170, null);
    mDrawable.draw(canvas);
    long now = android.os.SystemClock.uptimeMillis();
    if (mMovieStart == 0) {   // first time
      mMovieStart = now;
    }
    if (mMovie != null) {
      int dur = mMovie.duration();
      if (dur == 0) {
        dur = 1000;
      }
      int relTime = (int)((now - mMovieStart) % dur);
      mMovie.setTime(relTime);
      mMovie.draw(canvas, getWidth() - mMovie.width(),
            getHeight() - mMovie.height());
      invalidate();
    }
  }
}

代码示例来源:origin: andforce/iBeebo

mGifh = mMovie.height();

代码示例来源:origin: smuyyh/SprintNBA

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  if (mMovie != null) {
    int movieWidth = mMovie.width();
    int movieHeight = mMovie.height();
    int maximumWidth = MeasureSpec.getSize(widthMeasureSpec);
    float scaleW = (float) movieWidth / (float) maximumWidth;
    mScale = 1f / scaleW;
    mMeasuredMovieWidth = maximumWidth;
    mMeasuredMovieHeight = (int) (movieHeight * mScale);
    setMeasuredDimension(mMeasuredMovieWidth, mMeasuredMovieHeight);
  } else {
    setMeasuredDimension(getSuggestedMinimumWidth(),
        getSuggestedMinimumHeight());
  }
}

代码示例来源:origin: gizwits/GOpenSource_AppKit_Android_AS

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  if (mMovie != null) {
    int movieWidth = mMovie.width();
    int movieHeight = mMovie.height();
    int maximumWidth = MeasureSpec.getSize(widthMeasureSpec);
    float scaleW = (float) movieWidth / (float) maximumWidth;
    mScale = 1f / scaleW;
    mMeasuredMovieWidth = maximumWidth;
    mMeasuredMovieHeight = (int) (movieHeight * mScale);
    setMeasuredDimension(mMeasuredMovieWidth, mMeasuredMovieHeight);
  } else {
    setMeasuredDimension(getSuggestedMinimumWidth(), getSuggestedMinimumHeight());
  }
}

代码示例来源:origin: xuhongv/SmartHome

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  if (mMovie != null) {
    int movieWidth = mMovie.width();
    int movieHeight = mMovie.height();
    int maximumWidth = MeasureSpec.getSize(widthMeasureSpec);
    float scaleW = (float) movieWidth / (float) maximumWidth;
    mScale = 1f / scaleW;
    mMeasuredMovieWidth = maximumWidth;
    mMeasuredMovieHeight = (int) (movieHeight * mScale);
    setMeasuredDimension(mMeasuredMovieWidth, mMeasuredMovieHeight);
  } else {
    setMeasuredDimension(getSuggestedMinimumWidth(), getSuggestedMinimumHeight());
  }
}

代码示例来源:origin: adhishlal/GifLoader

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  if(mMovie != null){
    setMeasuredDimension(mMovie.width(), mMovie.height());
  }else{
    setMeasuredDimension(getSuggestedMinimumWidth(), getSuggestedMinimumHeight());
  }
}

相关文章