• 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 ; }这种。
        实现接口时,必须和接口的格式一致。
        必须实现接口的所有方法。

  • 相关阅读:
    start pyhton project(2)
    java.lang.ClassFormatError: Truncated class file
    linux 查看计算机信息命令
    VS2010UltimTrialCHS 版注册码
    VS2008打包安装程序,实现覆盖安装设置
    WPF移动不规则渐变色窗体
    C#下移动无边框窗体(直接粘贴可用)
    TCP通信过程中时时监测连接是否已断开
    WIN7下使用DotNetBar,关闭Aero效果,使用Office2007Form皮肤
    【原创】企业级工作流管理系统评价依据或标准
  • 原文地址:https://www.cnblogs.com/sntetwt/p/9217505.html
Copyright © 2020-2023  润新知