Codota Logo
SurfaceView.getHeight
Code IndexAdd Codota to your IDE (free)

How to use
getHeight
method
in
android.view.SurfaceView

Best Java code snippets using android.view.SurfaceView.getHeight (Showing top 8 results out of 315)

  • Common ways to obtain SurfaceView
private void myMethod () {
SurfaceView s =
  • Codota IconContext context;new SurfaceView(context)
  • Codota IconView view;(SurfaceView) view.findViewById(id)
  • Codota IconViewStub viewStub;(SurfaceView) viewStub.inflate()
  • Smart code suggestions by Codota
}
origin: Bilibili/DanmakuFlameMaster

@Override
public int getViewHeight() {
  return super.getHeight();
}
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: stackoverflow.com

final SurfaceView surface = (SurfaceView) findViewById(R.id.surface);
 surface.post(new Runnable() {
   @Override
   public void run() {
     TranslateAnimation translation = new TranslateAnimation(0f, 0f, surface.getHeight(), 0f);
     translation.setDuration(2000);
     surface.startAnimation(translation);
   }
 });
origin: purrprogramming/voice-pitch-analyzer

Double pxPerHz = this.gradient.getHeight() / pitchRange;
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);
textPaint.setAlpha(255);
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);
canvas.drawText(String.valueOf(PitchCalculator.minMalePitch), 10, this.gradient.getHeight() - (float)
    ((PitchCalculator.minMalePitch - PitchCalculator.minPitch) * pxPerHz) - 20, textPaint);
canvas.drawText(String.valueOf(PitchCalculator.maxMalePitch), 10, this.gradient.getHeight() - (float)
    ((PitchCalculator.maxMalePitch - PitchCalculator.minPitch) * pxPerHz) - 20, textPaint);
canvas.drawText(String.valueOf(PitchCalculator.minMalePitch + ((PitchCalculator.minFemalePitch - PitchCalculator.minMalePitch) / 2)), 10, this.gradient.getHeight() - (float)
    (((PitchCalculator.minMalePitch + (PitchCalculator.minFemalePitch - PitchCalculator.minMalePitch) / 2) - PitchCalculator.minPitch)* pxPerHz) + 10, textPaint);
canvas.drawText(String.valueOf(PitchCalculator.minFemalePitch), 10, this.gradient.getHeight() - (float)
    ((PitchCalculator.minFemalePitch - PitchCalculator.minPitch) * pxPerHz) + 35, textPaint);
origin: werbhelius/MediaUtils

List<Camera.Size> mSupportedVideoSizes = parameters.getSupportedVideoSizes();
Camera.Size optimalSize = CameraHelper.getOptimalVideoSize(mSupportedVideoSizes,
    mSupportedPreviewSizes, mSurfaceView.getWidth(), mSurfaceView.getHeight());
origin: pedroSG94/vlc-example-streamplayer

 vlcOut.setVideoView(surfaceView);
 width = surfaceView.getWidth();
 height = surfaceView.getHeight();
} else if (textureView != null) {
 vlcOut.setVideoView(textureView);
android.viewSurfaceViewgetHeight

Popular methods of SurfaceView

  • getHolder
  • <init>
  • onMeasure
  • onInitializeAccessibilityEvent
  • onInitializeAccessibilityNodeInfo
  • setLayoutParams
  • onKeyDown
  • setOnTouchListener
  • onDetachedFromWindow
  • setVisibility
  • getLayoutParams
  • onAttachedToWindow
  • getLayoutParams,
  • onAttachedToWindow,
  • onTouchEvent,
  • onSizeChanged,
  • setOnClickListener,
  • getWidth,
  • setKeepScreenOn,
  • onLayout,
  • setZOrderOnTop

Popular in Java

  • Parsing JSON documents to java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now