E:\Visual_C__MFC擴(kuò)展編程實(shí)例 例18
動(dòng)態(tài)地抓取應(yīng)用程序的屏幕圖像并將其打印。
上一個(gè)實(shí)例打印的是文檔的報(bào)表,而不是當(dāng)前出現(xiàn)在屏幕上的內(nèi)容。在本例中,將實(shí)現(xiàn)
屏幕抓取并打印其內(nèi)容。M F C 為打印視提供了有限的支持, 但只要用M F C 在
C Vi e w : : O n D r a w ( )中所提供的設(shè)備環(huán)境,就可以繪制自己的視。在打印視的時(shí)候, M F C只需調(diào)
用具備打印機(jī)設(shè)備環(huán)境的O n D r a w ( )函數(shù)即可。但是,如果不繪制自己的視,例如,用一個(gè)或
者一個(gè)以上的控件窗口填充自己的視就不會(huì)打印任何東西。每個(gè)控件將使用自己的設(shè)備環(huán)境
將自己打印到屏幕,因此打印視的唯一途徑就是抓取屏幕(拷貝其內(nèi)容到一個(gè)位圖對(duì)象)并將其
打印到打印機(jī)。由于該功能整個(gè)與位圖相關(guān),因此將該功能封裝到了位圖類中。
實(shí)現(xiàn)最優(yōu)二叉樹的構(gòu)造;在此基礎(chǔ)上完成哈夫曼編碼器與譯碼器。 假設(shè)報(bào)文中只會(huì)出現(xiàn)如下表所示的字符:
字符 A B C D E F G H I J K L M N
頻度 186 64 13 22 32 103 21 15 47 57 1 5 32 20 57
字符 O P Q R S T U V W X Y Z , .
頻度 63 15 1 48 51 80 23 8 18 1 16 1 6 2
要求完成的系統(tǒng)應(yīng)具備如下的功能:
1.初始化。從終端(文件)讀入字符集的數(shù)據(jù)信息,。建立哈夫曼樹。
2.編碼:利用已建好的哈夫曼樹對(duì)明文文件進(jìn)行編碼,并存入目標(biāo)文件(哈夫曼碼文件)。
3.譯碼:利用已建好的哈夫曼樹對(duì)目標(biāo)文件(哈夫曼碼文件)進(jìn)行編碼,并存入指定的明文文件。
4.輸出哈夫曼編碼文件:輸出每一個(gè)字符的哈夫曼編碼。
a Java program that reads in the following values from the standard input device (i.e.
Keyboard) and writes its result on the standard output device (i.e. Console/Monitor):
Inputs:
A: the loan amount in dollars and cents (e.g. 150000.00).
r: the net annual interest rate, expressed as an integer (e.g. 10 which means 10%)
Y: the number of whole remaining years (for repayment)
M: the number of remaining months
Output:
The program should calculate and output the amount of monthly repayments in dollars and cents as
single value (e.g. $840.55)
E-book Operating System Concepts 6th edition
OS programming bible, the dinosaur book, excellent reference
Abraham Silberschatz
Peter Baer Galvin
Greg Gagne