【问题标题】:How to send Memorystream from http socket如何从 http 套接字发送 Memorystream
【发布时间】:2019-03-29 09:20:15
【问题描述】:

我有一个 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 应用程序 VideoViewImageView 中获得我在 PictureBox1 中看到的内容

经过几天的研究,我无法找到任何最低限度的工作。

我可以在网络浏览器中通过 http 看到流,但我无法从任何 VideoViewImageView 获取。

【问题讨论】:

    标签: vb.net winforms xamarin memorystream


    【解决方案1】:

    我有一个解决方案,它很简单,但很有效。

    我使用WebView 在我的 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");
    

    Axml:

    <?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>
    

    【讨论】:

      猜你喜欢
      • 2013-07-23
      • 2020-08-29
      • 2014-03-31
      • 2013-05-14
      • 1970-01-01
      • 1970-01-01
      • 2016-04-28
      • 2012-05-27
      • 1970-01-01
      相关资源
      最近更新 更多