gpt4 book ai didi

java - Android VideoView - 可以在视频播放时为 MP4 着色/添加色调吗?

转载 作者:行者123 更新时间:2023-12-01 09:38:41 26 4
gpt4 key购买 nike

我正在尝试在 MP4 播放时为 VideoView 着色/添加色调。例如,应添加蓝色色调,并且视频在播放时保持可见。这可能吗?

<VideoView
android:id="@+id/myVideo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
android:layout_centerInParent="true" />

最佳答案

我相信您可以使用框架布局将带有可绘制对象的 View 覆盖到视频上。您可以将视频顶部 View 的背景设置为带有 Alpha channel 的背景。像这样的东西:

<FrameLayout 
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<VideoView
android:id="@+id/myVideo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
android:layout_centerInParent="true"/>
<View
android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="@color/semi_transparent_blue"/>
<FrameLayout/>

关于java - Android VideoView - 可以在视频播放时为 MP4 着色/添加色调吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38620663/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com