image
MyToolkit函式庫加入模擬滑鼠事件
 1: #region 設定滑鼠位置
 2: [DllImport("user32.dll")]
 3: public static extern bool SetCursorPos(int x, int y);
 4: #endregion
 5: #region 模擬滑鼠事件
 6: [DllImport("user32.dll")]
 7: public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
 8: public const int MOUSEEVENTF_LEFTDOWN = 0x02;
 9: public const int MOUSEEVENTF_LEFTUP = 0x04;
 10: #endregion

me1237guy 發表在 痞客邦 留言(2) 人氣()

image
> imageBatchProcessor 這個是2015a版本才有的影像批次處理工具  (Image Batch Processor) 應用如MRI影像資料, 適合批次處理多張影像(image sequence)來源, 可以省去相關UI開發瑣事 使用者可以指定所要載入的影像序列需要經過哪些影像處理函式

me1237guy 發表在 痞客邦 留言(0) 人氣()

參考資料: Transfer picture (jpg) over the network using NetworkStream

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
MyToolkit函式庫加入設定系統時間
 1: using System.Windows.Forms;
 2: using System.Runtime.InteropServices;

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
MyToolkit函式庫加入Ini檔案讀寫功能  
 1: using System;
 2: using System.Collections.Generic;
 3: using System.Linq;
 4: using System.Text;
 5:  
 6: using System.Runtime.InteropServices;
 7: namespace MyToolkit
 8: {
 9: 
 10: public class IniFileTool
 11: {
 12: public string path;
 13: [DllImport("kernel32")]
 14: private static extern long WritePrivateProfileString(string section,
 15: string key, string val, string filePath);
 16: [DllImport("kernel32")]
 17: private static extern int GetPrivateProfileString(string section,
 18: string key, string def, StringBuilder retVal,
 19: int size, string filePath);
 20: /// <summary>
 21: /// INIFile Constructor.
 22: /// </summary>
 23: /// <PARAM name="INIPath"></PARAM>
 24: public IniFileTool(string INIPath)
 25: {
 26: path = INIPath;
 27: }
 28: /// <summary>
 29: /// Write Data to the INI File
 30: /// </summary>
 31: /// <PARAM name="Section"></PARAM>
 32: /// Section name
 33: /// <PARAM name="Key"></PARAM>
 34: /// Key Name
 35: /// <PARAM name="Value"></PARAM>
 36: /// Value Name
 37: public void IniWriteValue(string Section, string Key, string Value)
 38: {
 39: WritePrivateProfileString(Section, Key, Value, this.path);
 40: }
 41:  
 42: /// <summary>
 43: /// Read Data Value From the Ini File
 44: /// </summary>
 45: /// <PARAM name="Section"></PARAM>
 46: /// <PARAM name="Key"></PARAM>
 47: /// <PARAM name="Path"></PARAM>
 48: /// <returns></returns>
 49: public string IniReadValue(string Section, string Key)
 50: {
 51: StringBuilder temp = new StringBuilder(255);
 52: int i = GetPrivateProfileString(Section, Key, "", temp,
 53: 255, this.path);
 54: return temp.ToString();
 55:  
 56: }
 57: }
 58: }

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
拉一個MenuStrip, SplitContainer和ListView元件 加入3個button 設定splitContainer1.Panel2的背景圖, 點選BackgroundImage選擇想要的背景圖片

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
人機介面如下: imageList加入圖示 圖片來源: food icon

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
修改Form的FormBoarderStyle屬性->None 完成後加入1個panel命名為panel_All panel_All的Dock屬性改成Fill 加入3個pictureBox分別命名為pictureBox_Min, pictureBox_Max和pictureBox_Close pictureBox_Min的Tag屬性值=0 pictureBox_Max的Tag屬性值=1 pictureBox_Close的Tag屬性值=2

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
加入命名空間


 1: using Microsoft.Win32;


me1237guy 發表在 痞客邦 留言(0) 人氣()

image
「Lambda 運算式」(Lambda Expression) 是一種匿名函式, 它可以包含運算式和陳述式 (Statement),而且可以用來建立委派 (Delegate)

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
    加入 Form1_Load事件
 1: delegate int multiply(int x, int y);
 2: delegate int timestwo(int x); // [1] 新增一個叫做timestwo的delegate,其輸入個數 = 1, 輸出個數=1 
 3:  
 4: timestwo t = delegate(int x) { return 2 * x; }; // 定義一個timestwo變數t, 利用匿名方法初始化之 
 5: multiply m = delegate(int x, int y) { return x * y; };
 6: private void button2_Click(object sender, EventArgs e)
 7: {
 8: MessageBox.Show(t(5).ToString());
 9: MessageBox.Show( m(5, 6).ToString());
 10: }

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
(1) RJ45轉RS232 (2) RS232轉USB (3) 電子鐘<->RJ45轉RS232轉換器接線 如下 (4)電子鐘電源接上後, 預設0:00.00

me1237guy 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。