如果大家用過 sharepoint portal server 2001,一定會記得增加型文件夾中的一些很不錯的特性,如文檔檢出/檢入、發布、審批流程等,其中最吸引我的就是它通過在文檔的圖標上加一個特別的標記,來表示文檔的狀態,如下圖所示:
自己在做文檔管理系統時,也借鑒了這種做法,其實和給圖片加水印的作法類似,主要代碼如下:
//取源圖像
image imgphoto = image.fromfile(ssourcefile);
bitmap bmphoto = new bitmap(imgphoto.width, imgphoto.height, pixelformat.format24bpprgb);
bmphoto.maketransparent();
//設置繪圖面屬性,呈現質量等 
graphics grphoto = graphics.fromimage(bmphoto); 
grphoto.smoothingmode = smoothingmode.antialias; 
grphoto.drawimage( imgphoto, new rectangle(0, 0, imgphoto.width, imgphoto.height), 0, 0, imgphoto.width, mgphoto.height, graphicsunit.pixel); 
//打開要附加的水印圖片
image imgwatermark = new bitmap(swatermarkfile);
bitmap bmwatermark = new bitmap(bmphoto); 
bmwatermark.setresolution(imgphoto.horizontalresolution, imgphoto.verticalresolution);
graphics grwatermark = graphics.fromimage(bmwatermark);
int xposofwm = imgphoto.width - imgwatermark.width;
int yposofwm = imgphoto.height - imgwatermark.height;
//畫
grwatermark.drawimage(imgwatermark, 
 new rectangle(xposofwm,yposofwm,imgwatermark.width,imgwatermark.height),
 0, 
 0, 
 imgwatermark.width, 
 imgwatermark.height, 
 graphicsunit.pixel);
//保存最終圖片
imgphoto = bmwatermark;
imgphoto.save(siconfilename,imageformat.png);
如果文檔有審閱流程,那文檔的流轉圖就非常受歡迎了,這樣用戶可以方便地查看文檔正處于那個階段。
其實與工作流有關軟件可能都有這樣要求,我目前沒有找到更好的辦法,利用 <table> ,將各個階段
用線條和圖形表示出來,辦法雖有點笨,但好象顯示效果還不錯。
曾經試過 vml ,發現要動態地畫這種圖,就得很精確地控制屏幕上位置,比較麻煩,后來放棄了這種作法。
還曾經想用 visio automation 來試一下,發現 visio 的對象模型和 vba 比 word 和 excel 的難多了,工作量更大。
國內最大的酷站演示中心!