vb.net - 如何从 http 套接字发送 Memorystream
问题描述
我有一个 VB WinForms 应用程序,我从某个地方得到了框架。应用程序不是我开发的。
_ImageList = New Queue(Of MemoryStream)
Dim bmpdecode As New Bitmap(nWidth, nHeight)
Dim ms As New MemoryStream
bmpdecode.Save(ms, Imaging.ImageFormat.Jpeg)
_ImageList.Enqueue(ms)
PictureBox1.BeginInvoke(New DelPintarImagen(AddressOf DrawImage), New Object() {bmpdecode})
DrawImage
是位图类型。
我想要的是从 Xamarin android 应用程序VideoView
或ImageView
我看到的PictureBox1
经过几天的研究,我无法找到任何最低限度的工作。
我可以在网络浏览器中通过 http 看到流,但我无法从任何VideoView
或ImageView
.
解决方案
我有一个解决方案,它很简单,但很有效。
我使用 aWebView
在我的 Xamarin 应用程序中显示流,禁用缩放选项,因此对于用户来说,它看起来像是在播放流。
C#代码:
var wPlayer = FindViewById<WebView>(Resource.Id.webView1);
//Zoom Out for stretch the content by the width.
wPlayer.Settings.LoadWithOverviewMode = true;
wPlayer.Settings.UseWideViewPort = true;
wPlayer.SetPadding(0, 0, 0, 0);
wPlayer.LoadUrl("http://ip:port/?params");
xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_main">
<android.webkit.WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/webView1"
/>
</RelativeLayout>
推荐阅读
- c# - How to make Windows forms app to support Older versions of MS Office?
- python - Beautiful Soup : 如何从不一致的数据中提取 HTML 标签中的数据
- django - 如何在没有默认 Django 数据库表的情况下创建 Django 项目
- ios - 如何确定 Xcode 项目中图像的最佳尺寸?
- java - ubuntu命令行./idea.sh可以启动idea,但是桌面图标点击找不到JDK
- ios - 如何将Objective C函数的地址传递给C函数?
- bash - 如何在 git-bash 的 git 别名中使用一行连字符来分隔 git 命令结果
- c# - 选择页面时如何重新初始化选项卡控件页面上的自定义控件
- ios - SwiftUI如何在点击按钮时推送到下一个屏幕
- azure - 将 AD 用户身份验证传递给 Azure REST API 调用以预配资源