本文整理了Java中android.view.SurfaceView.getWidth()
方法的一些代码示例,展示了SurfaceView.getWidth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SurfaceView.getWidth()
方法的具体详情如下:
包路径:android.view.SurfaceView
类名称:SurfaceView
方法名:getWidth
暂无
代码示例来源:origin: Bilibili/DanmakuFlameMaster
@Override
public int getViewWidth() {
return super.getWidth();
}
代码示例来源:origin: stackoverflow.com
//The following two are just for viewing sake, they should be defined somewhere
SurfaceView targetSurfaceView;
Bitmap mySourceBitmap;
Bitmap scaledBitmap = Bitmap.createScaledBitmap(mySourceBitmap,
targetSurfaceView.getWidth(),
targetSurfaceView.getHeight(),
true);
代码示例来源:origin: harjot-oberai/AndroidDigitClassifier
private Rect calculateFocusArea(float x, float y) {
int left = clamp(Float.valueOf((x / preview.getWidth()) * 2000 - 1000).intValue(), FOCUS_AREA_SIZE);
int top = clamp(Float.valueOf((y / preview.getHeight()) * 2000 - 1000).intValue(), FOCUS_AREA_SIZE);
return new Rect(left, top, left + FOCUS_AREA_SIZE, top + FOCUS_AREA_SIZE);
}
代码示例来源:origin: googlesamples/android-ScreenCapture
private void setUpVirtualDisplay() {
Log.i(TAG, "Setting up a VirtualDisplay: " +
mSurfaceView.getWidth() + "x" + mSurfaceView.getHeight() +
" (" + mScreenDensity + ")");
mVirtualDisplay = mMediaProjection.createVirtualDisplay("ScreenCapture",
mSurfaceView.getWidth(), mSurfaceView.getHeight(), mScreenDensity,
DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR,
mSurface, null, null);
mButtonToggle.setText(R.string.stop);
}
代码示例来源:origin: werbhelius/MediaUtils
List<Camera.Size> mSupportedVideoSizes = parameters.getSupportedVideoSizes();
Camera.Size optimalSize = CameraHelper.getOptimalVideoSize(mSupportedVideoSizes,
mSupportedPreviewSizes, mSurfaceView.getWidth(), mSurfaceView.getHeight());
代码示例来源:origin: purrprogramming/voice-pitch-analyzer
this.gradient.getWidth(),
this.gradient.getBottom() - (float) ((PitchCalculator.maxFemalePitch - PitchCalculator.minPitch) * pxPerHz),
canvas.drawText(getResources().getString(R.string.female_range), this.gradient.getWidth() - 10, this.gradient.getHeight() - (float)
((PitchCalculator.maxFemalePitch - PitchCalculator.minPitch) * pxPerHz) + 20*dm.density, textPaint);
canvas.drawRect(0,
this.gradient.getHeight() - (float) ((PitchCalculator.minMalePitch - PitchCalculator.minPitch) * pxPerHz),
this.gradient.getWidth(),
this.gradient.getHeight() - (float) ((PitchCalculator.maxMalePitch - PitchCalculator.minPitch) * pxPerHz),
canvas.drawText(getResources().getString(R.string.male_range), this.gradient.getWidth() - 10, this.gradient.getHeight() - (float)
((PitchCalculator.maxMalePitch - PitchCalculator.minPitch -
(PitchCalculator.maxMalePitch - PitchCalculator.minFemalePitch)) * pxPerHz) + 150*dm.density, textPaint);
canvas.drawText(getResources().getString(R.string.androgynous_range), this.gradient.getWidth() - 10, this.gradient.getHeight() - (float)
((PitchCalculator.maxMalePitch - PitchCalculator.minPitch) * pxPerHz) + 22*dm.density, textPaint);
代码示例来源:origin: pedroSG94/vlc-example-streamplayer
width = surfaceView.getWidth();
height = surfaceView.getHeight();
} else if (textureView != null) {
内容来源于网络,如有侵权,请联系作者删除!