- 浏览: 216805 次
- 性别:
- 来自: 上海
-
文章分类
- 全部博客 (196)
- android (153)
- sqlite (1)
- java (3)
- os (4)
- tools (4)
- ResolveInfo 转 packageinf 取信息 (1)
- multimedia (2)
- fastboot (1)
- create user in samba (0)
- android qcn (0)
- windows (0)
- net (2)
- linux (1)
- git (0)
- proguard (0)
- android cpu (1)
- android gts (1)
- MySql (1)
- c/c++ (0)
- network (1)
- python (3)
- AI (1)
- Ultroedit (1)
- HarmonyOS NEXT (0)
/**
* Provides a dedicated drawing surface embedded inside of a view hierarchy.
* You can control the format of this surface and, if you like, its size; the
* SurfaceView takes care of placing the surface at the correct location on the
* screen
*
* <p>The surface is Z ordered so that it is behind the window holding its
* SurfaceView; the SurfaceView punches a hole in its window to allow its
* surface to be displayed. The view hierarchy will take care of correctly
* compositing with the Surface any siblings of the SurfaceView that would
* normally appear on top of it. This can be used to place overlays such as
* buttons on top of the Surface, though note however that it can have an
* impact on performance since a full alpha-blended composite will be performed
* each time the Surface changes.
*
* <p> The transparent region that makes the surface visible is based on the
* layout positions in the view hierarchy. If the post-layout transform
* properties are used to draw a sibling view on top of the SurfaceView, the
* view may not be properly composited with the surface.
*
* <p>Access to the underlying surface is provided via the SurfaceHolder interface,
* which can be retrieved by calling {@link #getHolder}.
*
* <p>The Surface will be created for you while the SurfaceView's window is
* visible; you should implement {@link SurfaceHolder.Callback#surfaceCreated}
* and {@link SurfaceHolder.Callback#surfaceDestroyed} to discover when the
* Surface is created and destroyed as the window is shown and hidden.
*
* <p>One of the purposes of this class is to provide a surface in which a
* secondary thread can render into the screen. If you are going to use it
* this way, you need to be aware of some threading semantics:
*
* <ul>
* <li> All SurfaceView and
* {@link SurfaceHolder.Callback SurfaceHolder.Callback} methods will be called
* from the thread running the SurfaceView's window (typically the main thread
* of the application). They thus need to correctly synchronize with any
* state that is also touched by the drawing thread.
* <li> You must ensure that the drawing thread only touches the underlying
* Surface while it is valid -- between
* {@link SurfaceHolder.Callback#surfaceCreated SurfaceHolder.Callback.surfaceCreated()}
* and
* {@link SurfaceHolder.Callback#surfaceDestroyed SurfaceHolder.Callback.surfaceDestroyed()}.
* </ul>
*/
@Override
public void draw(Canvas canvas) {
if (mWindowType != WindowManager.LayoutParams.TYPE_APPLICATION_PANEL) {
// draw() is not called when SKIP_DRAW is set
if ((mPrivateFlags & PFLAG_SKIP_DRAW) == 0) {
// punch a whole in the view-hierarchy below us
canvas.drawColor(0, PorterDuff.Mode.CLEAR);
}
}
super.draw(canvas);
}
* Provides a dedicated drawing surface embedded inside of a view hierarchy.
* You can control the format of this surface and, if you like, its size; the
* SurfaceView takes care of placing the surface at the correct location on the
* screen
*
* <p>The surface is Z ordered so that it is behind the window holding its
* SurfaceView; the SurfaceView punches a hole in its window to allow its
* surface to be displayed. The view hierarchy will take care of correctly
* compositing with the Surface any siblings of the SurfaceView that would
* normally appear on top of it. This can be used to place overlays such as
* buttons on top of the Surface, though note however that it can have an
* impact on performance since a full alpha-blended composite will be performed
* each time the Surface changes.
*
* <p> The transparent region that makes the surface visible is based on the
* layout positions in the view hierarchy. If the post-layout transform
* properties are used to draw a sibling view on top of the SurfaceView, the
* view may not be properly composited with the surface.
*
* <p>Access to the underlying surface is provided via the SurfaceHolder interface,
* which can be retrieved by calling {@link #getHolder}.
*
* <p>The Surface will be created for you while the SurfaceView's window is
* visible; you should implement {@link SurfaceHolder.Callback#surfaceCreated}
* and {@link SurfaceHolder.Callback#surfaceDestroyed} to discover when the
* Surface is created and destroyed as the window is shown and hidden.
*
* <p>One of the purposes of this class is to provide a surface in which a
* secondary thread can render into the screen. If you are going to use it
* this way, you need to be aware of some threading semantics:
*
* <ul>
* <li> All SurfaceView and
* {@link SurfaceHolder.Callback SurfaceHolder.Callback} methods will be called
* from the thread running the SurfaceView's window (typically the main thread
* of the application). They thus need to correctly synchronize with any
* state that is also touched by the drawing thread.
* <li> You must ensure that the drawing thread only touches the underlying
* Surface while it is valid -- between
* {@link SurfaceHolder.Callback#surfaceCreated SurfaceHolder.Callback.surfaceCreated()}
* and
* {@link SurfaceHolder.Callback#surfaceDestroyed SurfaceHolder.Callback.surfaceDestroyed()}.
* </ul>
*/
@Override
public void draw(Canvas canvas) {
if (mWindowType != WindowManager.LayoutParams.TYPE_APPLICATION_PANEL) {
// draw() is not called when SKIP_DRAW is set
if ((mPrivateFlags & PFLAG_SKIP_DRAW) == 0) {
// punch a whole in the view-hierarchy below us
canvas.drawColor(0, PorterDuff.Mode.CLEAR);
}
}
super.draw(canvas);
}
发表评论
-
Android SnappyDB
2018-05-15 11:23 993https://blog.csdn.net/qq_214305 ... -
使用UncaughtExceptionHandler保存全局异常(转)
2018-05-07 15:04 664From: https://blog.csdn.net/dre ... -
android udp
2018-04-10 19:47 623Android之Socket的基于UDP传输 接收方创建步骤: ... -
android DownloadManager
2018-04-10 12:52 617From: https://www.jianshu.com/p ... -
Snackbar 可以交互的Toast
2018-04-08 21:44 790Snackbar 是 Android design sup ... -
android 操作串口
2018-03-19 18:20 683http://blog.csdn.net/akunainian ... -
proguard对 android-support-v4.jar 的配置
2018-03-16 15:32 743-libraryjars libs/android-sup ... -
apk 多个dex
2018-03-16 10:05 1025android studio 配置应用生成多个dex ... -
ddmlib 解决android n file explorer 为空问题
2018-03-16 09:27 968百度云:http://pan.baidu.com/s/1sl4 ... -
android 代码混淆
2018-03-15 08:38 1076打开混淆开关 Android.mk ... -
menu item 显示icon
2018-03-07 09:32 710@Override public boolean onMenu ... -
ubuntu 脚本切换root用户,并执行其它脚本
2018-03-05 09:58 0#!/bin/bash expect -c" ... -
DrawerLayout 滑动侧边栏
2018-03-01 10:42 0// TODO -
jack-server 多用户编译问题
2018-02-27 10:44 14173),需要同时修改 $HOME/.jack-server/co ... -
更新eclipse 遇到两个问题 Oxygen.2 Release (4.7.2)
2018-02-26 14:28 12471. the file dx.jar was not load ... -
监听系统开关变化
2018-02-05 14:02 820// 转屏开关 /** * Content obse ... -
android 8.0 模块编译命令
2018-02-02 14:42 1184Invoke ". build/envsetup.s ... -
svn checkout 忽略某个文件夹
2018-01-26 11:14 1377android源码更新时, frameworks\compil ... -
eclipse jni
2018-01-19 16:10 500试过,可以运行 http://blog.csdn.net/sb ... -
opencv for android
2018-01-19 14:37 455http://blog.csdn.net/sbsujjbcy/ ...
相关推荐
在Android平台上进行游戏开发时,SurfaceView是一个至关重要的组件,它是专门为高性能图形设计的,比如游戏、视频播放等需要连续刷新显示的应用。SurfaceView提供了一种优化的绘图机制,可以将绘制操作与应用程序的...
在Android开发中,`SurfaceView`是一个非常重要的视图组件,尤其在处理视频播放、游戏渲染等高性能图形操作时,它的优势在于拥有独立于主线程的渲染机制,能避免阻塞UI更新。然而,由于其特殊的性质,直接通过常规...
在Android开发中,`SurfaceView`是一个特殊类型的`View`,它允许开发者在应用程序中创建一个独立于应用程序主线程的渲染表面。`SurfaceView`通常用于处理高性能的图形或者视频播放,因为它可以在单独的线程中进行...
SurfaceView是Android系统提供的一种特殊的View,主要用于处理高性能、低延迟的图形绘制,例如游戏画面或者视频播放等场景。它的核心特性在于拥有自己的独立线程(SurfaceThread)来管理Surface的绘制,这使得...
在Android平台上,SurfaceView是一种特殊的视图,常用于处理高性能的图形渲染,比如播放视频或者游戏画面。在视频播放场景中,SurfaceView提供了一个高效且低延迟的显示机制,能够将视频帧直接绘制到Surface上,减少...
在Android开发中,SurfaceView是一种特殊的视图,主要用于处理高性能的图形绘制,比如视频播放、游戏画面等。SurfaceView创建了一个独立的Surface,其后台线程可以无阻塞地进行绘图操作,提高了渲染效率。然而,由于...
在Android开发中,SurfaceView是一种特殊的视图,它允许开发者创建高性能的图形界面,尤其适合处理视频播放或游戏等需要连续刷新的场景。本话题主要探讨如何利用SurfaceView实现图片的缩放和滑动功能。 首先,理解...
在Android开发中,SurfaceView是一种特殊的视图,用于处理高性能的图形和视频渲染。这个压缩包文件"SurfaceView播放视频放大缩小功能.zip"显然包含了实现SurfaceView在播放视频时进行放大和缩小功能的相关代码和资源...
SurfaceView是Android系统中一种特殊的View,它在处理多媒体或者高性能图形渲染时有着独特的优势。在移动设备上,用户交互通常涉及到触摸事件,包括单点触摸和多点触控。多点触控允许用户通过两个或更多的手指进行...
在Android开发中,`SurfaceView` 是一个非常重要的视图组件,主要用于处理视频播放、游戏图形等高性能的图像渲染任务。`SurfaceView` 提供了一个独立的绘图表面,可以与应用程序主线程分离,从而避免UI阻塞,提高...
这个场景就涉及到了Android的SurfaceView以及如何定制它的显示效果。本文将深入探讨如何实现一个圆形的相机预览窗口。 首先,让我们理解SurfaceView的基本概念。SurfaceView是Android系统提供的一种用于显示多媒体...
`SurfaceView`是Android提供的一种用于高效显示多媒体数据的视图组件,尤其适合处理像视频流这样的实时数据。本篇文章将深入探讨如何利用`SurfaceView`实现实时显示摄像头视频。 首先,我们需要了解`SurfaceView`的...
本篇文章将深入探讨`SurfaceView`与`layout`在屏幕适配中的应用及其策略。 首先,`SurfaceView`是Android提供的一种特殊视图,它允许开发者在应用程序中直接进行硬件加速的图形绘制,如视频播放、游戏画面等高性能...
在Android开发中,SurfaceView是一种特殊的视图,用于高效地显示动态图像,比如播放视频或者进行游戏渲染。标题“SurfaceView放大和缩小”涉及到的是如何在Android应用中实现对SurfaceView内的视频画面进行局部放大...
SurfaceView是Android系统中一种特殊的View,主要用于处理高性能、低延迟的图形绘制和视频播放等任务。在Android应用开发中,尤其是涉及到视频播放时,SurfaceView是一个非常关键的组件。这个例子是基于SurfaceView...
SurfaceView和TextureView均继承于android.view.View 与其它View不同的是,两者都能在独立的线程中绘制和渲染,在专用的GPU线程中大大提高渲染的性能。 一、SurfaceView专门提供了嵌入视图层级的绘制界面,开发者...
在Android开发中,`SurfaceView`是一个特殊类型的视图,常用于处理高性能的图形和视频渲染,例如游戏或相机预览。它拥有自己的独立于主线程的渲染表面,可以提供流畅的动画效果,且对CPU和GPU资源的利用更为高效。`...