zoukankan      html  css  js  c++  java
  • WPF腾讯视频通话开发

    一、IntPtr、Handle
    C#中的IntPtr类型称为“平台特定的整数类型”,它们用于本机资源,如窗口句柄。

    1、WPF窗口句柄
    IntPtr wnip = new System.Windows.Interop.WindowInteropHelper(this).Handle;

    2、WPF控件句柄
    System.Windows.Interop.HwndSource hs = (System.Windows.Interop.HwndSource)PresentationSource.FromDependencyObject(panel_local);
    IntPtr fdip = hs.Handle;

    WinForm Handle
    IntPtr h = label1.Handle;
    ((Label)Control.FromHandle(h)).Text = "00";

    二、导入dll
    copy /Y "$(ProjectDir)SDKliteav*.dll" "$(ProjectDir)bin$(ConfigurationName)"
    copy /Y "$(ProjectDir)SDKIM*.dll" "$(ProjectDir)bin$(ConfigurationName)"

    三、加载视频
    ManageLiteAV.TXLivePusher pusher = new ManageLiteAV.TXLivePusher();
    pusher.startPreview(ManageLiteAV.TXEVideoCaptureSrcType.TXE_VIDEO_SRC_SDK_CAMERA, handle, 0, 0, (int)panel_local.Width, (int)panel_local.Height, ManageLiteAV.TXEVideoUserDataFormat.TXE_USER_DATA_FORMAT_UNDEFINED);
    四、WPF嵌入WinForm控件
    如何在WPF中引用Windows.System.Forms.Integration
    解决方法如下:
    C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.5WindowsFormsIntegration.dll

    参考网址:
    https://blog.csdn.net/lianchangshuai/article/details/6415241
    https://www.cnblogs.com/sinozhang1988/archive/2012/11/28/2792804.html

    五、C# 接口(Interface)
    1、接口只包含了成员(属性、方法、事件)的声明。
    2、接口提供了派生类应遵循的标准结构。
    3、所有接口成员的默认访问类型都是public。
    4、接口使得实现接口的类或结构在形式上保持一致。

    定义接口:IInterface.cs
    interface IInterface
    {
        void MethodToImplement();
    }

    定义派生类:InterfaceImplementer.cs
    class InterfaceImplementer : IMyInterface
    {
        //实现接口成员
        public void MethodToImplement()
        {
        }
    }
    接口注意的几点:
        接口方法不能用public abstract等修饰。接口内不能有字段变量,构造函数。
        接口内可以定义属性(有get和set的方法)。如string color { get ; set ; }这种。
        实现接口时,必须和接口的格式一致。
        必须实现接口的所有方法。

  • 相关阅读:
    bzoj 3747: [POI2015]Kinoman
    bzoj 3123: [Sdoi2013]森林
    bzoj 1901: Zju2112 Dynamic Rankings
    poj 1741 Tree
    bzoj 2152: 聪聪可可
    bzoj 2599: [IOI2011]Race
    bzoj 3697: 采药人的路径
    bzoj 2728: [HNOI2012]与非
    bzoj 2115: [Wc2011] Xor
    bzoj 3143: [Hnoi2013]游走
  • 原文地址:https://www.cnblogs.com/sntetwt/p/9217505.html
Copyright © 2011-2022 走看看