C# Copy Code private void VaryQualityLevel(){ // Get a bitmap. Bitmap bmp1 = new Bitmap(@"c:/TestPhoto.jpg"); ImageCodecInfo jgpEncoder = GetEncoder(ImageFormat.Jpeg); // Create an Encoder object based on the GUID // for the Quality
一維數組和二維數組的轉換表示(C#)關鍵:下標的計算一維->二維一個n個元素的一維數組,轉換為r行c列的二維數組對於一維數組中任意一個元素的下標i(0 <= i < n)其對應的二維數組下標為 (i / c, i % c), 顯然, 只與列數c有關,而與行數r無關code like thisint[] a = new int[n];int[,] b = new int[r, c];for (int i = 0; i < n; i++) b[i / c, i % c]
函數 - 聲明、定義、調用 1. 如果函數沒有聲明, 應該在調用前定義:#include <stdio.h>/* 定義求大值函數 */int MAX(int x, int y) { if (x > y) return x; else return y;} /* 定義求小值函數 */int MIN(int x, int y) { return x < y ? x : y;} int main(void){ int a = 5; int b = 6;
C#學習11使用Windows表單應用程式,基於Windows Media Player組件寫一個簡單的播放器,功能比較簡陋,通過開啟檔案按鈕來選取音樂所在的地址,還有4個按鈕,分別是:播放,結束,暫停/繼續,歌曲資訊添加AxWindowsMediaPlayer控制項的方法:在”工具箱”中單擊右鍵,選擇”選擇項”菜單,開啟”選擇工具箱項”視窗,選擇”COM”組件”標籤,在列表中找到並勾選”Windows Media
get set是用來擴充域的,也就是C裡的變數,只是用起來更加靈活而己。看以下代碼: using System; public class cls { private int book;//定義一個域(也可以叫變數,只是面向對像裡都這麼叫,使用起來也更加方便) public int Book { get { Console.WriteLine("dsf"); return book; } set { Console.WriteLine("aaa");
The APR based Apache Tomcat Native library which allows optimal performanc現在用的tomcat6.0,不知道大家注意沒有,在啟動的時候,那個啟動視窗最上面出現這樣一條資訊:2008-10-4 22:59:03 org.apache.catalina.core.AprLifecycleListener init資訊: The APR based Apache Tomcat Native library which
C++ protected成員存取權限關於C++中protected的存取權限的討論已經是一個很陳舊的話題了,陳舊到大家都不願意去討論。我再次讀《C++ Primer》的時候,其中關於protected 成員的描述是這樣的:protected MembersThe protected access label can be thought of as a blend of private and public :Like private members, protected members