操控小程序温控器需要哪几个步骤?

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/silicontra521/article/details/88715971

随着时代的变迁,在这个电子科技迅速发展年代,智能产品已经在大部分国家地区广泛应用。在这个只有想不到、却没有做不到的科技社会,如何通过科学技术让消费者之所想真正地转化到每个产品上。现如今,温控器已经成为一种常见的家庭电器,它给生活带来便利,智能温控器问世以来也是受到广大人们的欢迎。

硅传科技研发生产的温控器,由微信小程序控制,不仅操作简单便捷,还能随时控温,能随时让室温达到您需要的温度。

操作步骤:

一、打开微信小程序,搜索“二十五度温控器”,如下图

二、登录,微信授权。如下图

三、授权成功后。如下图

四、打开蓝牙,按照下图所示,绑定智能温控器,如下图

五、选择温控器,如下图

六、输入无线网络账号密码,如下图

七、连接成功,修改温控器名称,如下图

八、调节温控器,选择舒适的温度,如下图

硅传科技拥有着完善的服务体系,快速解决客户设计和生产中的疑难问题。硅传根据客户不同需求,为客户推荐功能最合适,性价比最高的方案。同时,也为客户专门定制方案,从而更好实现客户最大市场价值。客户的赞赏与信赖是硅传一直向前永不停止的动力。欢迎来电咨询

 

 

 

 

 

 

 

 

 

 

 

展开阅读全文

求解 程序 《C# 操控摄像头》

01-20

[Quote=谢谢各位参与,和指导!!:]rn首先声明,如下代码是网上下载的,刚下时,没有多少注释,我能理解的都已标上了注释,rn代码中的[color=#008000]//xxx[/color]有我的问题!rn[color=#FF6600]如下程序:[/color] rn 已经过本人测试,是成功的!rn由于本程序是网上 抄人家的,有些代码看不懂,求解释!!!谢谢。rn 建winForm 程序, 先添加一个类:showVideo ,文件名为:showVideo.csrn[color=#008000]//这个类进行 摄像头操控,正是这个类里有很多代码是看不懂的!求解释。[/color]rn[/Quote]rn[code=C#]using System;rnusing System.Collections.Generic;rnusing System.Linq;rnusing System.Text;rnusing System.Runtime.InteropServices;rnusing System.Drawing;rnusing System.Drawing.Imaging;rnusing System.Net;rnusing System.Net.Sockets;rnusing System.Threading;rnusing System.Windows.Forms;rnnamespace USB_VIDEOrnrn#region [一个C#摄像头控制类 ]rn class VideoWorkrn rn //一些常量,rn // 我想这些常量,应该是 各种功能的代号吧。 就象C语言的错误码。rn //但是我看不明 这些代号的意义,应该去查什么书呢?rnrn private const int WM_USER = 0x400; rn private const int WS_CHILD = 0x40000000; rn private const int WS_VISIBLE = 0x10000000; rn private const int WM_CAP_START = WM_USER; rn private const int WM_CAP_STOP = WM_CAP_START + 68; rn private const int WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10; rn private const int WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11; rn private const int WM_CAP_SAVEDIB = WM_CAP_START + 25; rn private const int WM_CAP_GRAB_FRAME = WM_CAP_START + 60; rn private const int WM_CAP_SEQUENCE = WM_CAP_START + 62; rn private const int WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START + 20; rn private const int WM_CAP_SEQUENCE_NOFILE = WM_CAP_START + 63; rn private const int WM_CAP_SET_OVERLAY = WM_CAP_START + 51; rn private const int WM_CAP_SET_PREVIEW = WM_CAP_START + 50; rn private const int WM_CAP_SET_CALLBACK_VIDEOSTREAM = WM_CAP_START + 6; rn private const int WM_CAP_SET_CALLBACK_ERROR = WM_CAP_START + 2; rn private const int WM_CAP_SET_CALLBACK_STATUSA = WM_CAP_START + 3; rn private const int WM_CAP_SET_CALLBACK_FRAME = WM_CAP_START + 5; rn private const int WM_CAP_SET_SCALE = WM_CAP_START + 53; rn private const int WM_CAP_SET_PREVIEWRATE = WM_CAP_START + 52;rnrn private bool _bWorkStart =false; rn public bool bWorkStart rn rn get return _bWorkStart; rn set _bWorkStart = value; rn rnrn private IntPtr hWndC; rn private IntPtr mControlPtr; //变成panel1 的控件 的handlern private int mWidth; rn private int mHeight; rn private int mLeft; rn private int mTop;rnrn #region [初始化显示图像 ]rn #endregion rn /// 控件的句柄 rn /// 开始显示的左边距 rn /// 开始显示的上边距 rn /// 要显示的宽度 rn /// 要显示的长度 rn public VideoWork(IntPtr handle, int left, int top, int width, int height) rn rn mControlPtr = handle; rn mWidth = width; rn mHeight = height; rn mLeft = left; rn mTop = top;rn rnrn [DllImport("avicap32.dll")]rn//这个function 干什么 用?rn private static extern IntPtr capCreateCaptureWindowA(byte[] lpszWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, int nID);rn [DllImport("avicap32.dll")]rn//这个function 干什么 用?rn private static extern int capGetVideoFormat(IntPtr hWnd, IntPtr psVideoFormat, int wSize);rn [DllImport("User32.dll")]rn private static extern bool SendMessage(IntPtr hWnd, int wMsg, int wParam, long lParam); rnrn /// rn /// 开始显示图像 rn /// rn public void Start() rn rn byte[] lpszName = new byte[100]; //开劈这一 片内存有什么用?存了什么?rn //请问这句干什么用的,返回值 的hWndC 句柄 ,是谁的?。rn hWndC = capCreateCaptureWindowA(lpszName,WS_CHILD|WS_VISIBLE ,mLeft,mTop,mWidth,mHeight,mControlPtr,0); rn if (hWndC.ToInt32() != 0) rn rn //这里用了那么多 SendMessage,sendMessage 干了什么事?rn SendMessage(hWndC, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0); rn SendMessage(hWndC, WM_CAP_SET_CALLBACK_ERROR, 0, 0); rn SendMessage(hWndC, WM_CAP_SET_CALLBACK_STATUSA, 0, 0); rn SendMessage(hWndC, WM_CAP_DRIVER_CONNECT, 0, 0); rn SendMessage(hWndC, WM_CAP_SET_SCALE, 1, 0); rn SendMessage(hWndC, WM_CAP_SET_PREVIEWRATE, 66, 0); rn SendMessage(hWndC, WM_CAP_SET_OVERLAY, 1, 0); rn SendMessage(hWndC, WM_CAP_SET_PREVIEW, 1, 0); rn rn return; rn rnrn /// rn /// 停止显示 rn /// rn public void Stop() rn rn //sendMessage 向谁发了消息?干了什么事?rn SendMessage(hWndC, WM_CAP_DRIVER_DISCONNECT, 0, 0); //rn rn /// rn /// 抓图 rn /// rn /// 要保存bmp文件的路径 rn public String GrabImage(string path) rn rn IntPtr hBmp = Marshal.StringToHGlobalAnsi(path + "//aa.jpg");rn SendMessage(hWndC, WM_CAP_SAVEDIB, 0, hBmp.ToInt64());rn return path + "\\aa.jpg";rn rn rn#endregionrnrn[/code]rn[Quote=谢谢各位参与,和指导!!:]rn 下面的是应用代码。 给大家参考作用的。 也就是这个类的使用例子。rn[/Quote]rn[code=C#]rnnamespace USB_VIDEOrnrn public partial class Form1 : Formrn rn #region [公共变量]rn private IntPtr mControlPtr; // this.panel1.Handle;rn //图片大小rn private int mWidth;rn private int mHeight;rn private int mLeft;rn private int mTop;rnrn VideoWork vw; //视频 自定义的类。rn String bmp_path;rn #endregionrnrn public Form1()rn rn InitializeComponent();rnrn this.BackColor = Color.WhiteSmoke;rn this.StartPosition = FormStartPosition.CenterScreen;rn this.FormBorderStyle = FormBorderStyle.FixedDialog;rn this.MaximizeBox = true;//能不能最大化rn rnrn private void Form1_Load(object sender, EventArgs e)rn rn // panel1 的设定 rn this.panel1.BackColor = Color.Black;rn this.panel1.Size = new Size(320, 240);rn // 全局大小设定rn mControlPtr = this.panel1.Handle;rn mLeft = 0;rn mTop = 0;rn mWidth = 320;rn mHeight = 240;rn vw = new VideoWork(mControlPtr, mLeft, mTop, mWidth, mHeight);rn rnrn private void button1_Click(object sender, EventArgs e)//显示摄像头rn rn if (vw.bWorkStart == false)//是不是开始 ?rn rn vw.Start();rn vw.bWorkStart = true; //状态位rn rn rnrn private void button2_Click(object sender, EventArgs e)//关闭摄像头rn rn if (vw!=null) // 声明一个对象!rn rn if (vw.bWorkStart == true)//是不是开始 ?rn rn vw.Stop(); //关闭rn vw.bWorkStart = false; //状态位rn rn rn rn //拍照保存rn private void button3_Click(object sender, EventArgs e)rn rn if (vw.bWorkStart == false)rn rn MessageBox.Show("摄像头已关闭!");rn rn elsern rn //浏览文件夹rn FolderBrowserDialog dlg = new FolderBrowserDialog();rn if (dlg.ShowDialog() == DialogResult.OK)rn rn string dlgPath = dlg.SelectedPath.ToString();//取得路径rn bmp_path = vw.GrabImage(dlgPath);//文件名:rn if (System.IO.File.Exists(bmp_path))rn rn MessageBox.Show("图片文件" + bmp_path + "已经生成!");rn rn elsern rn MessageBox.Show("图片文件" + bmp_path + "没有生成!");rn rn rn elsern rn return;rn rn rn rn// 关闭rn private void button4_Click(object sender, EventArgs e)rn rn this.Dispose();rn rn rnrn[/code] 论坛

没有更多推荐了,返回首页