2011-03-02 136 views
2

失去了這個,我開發了一個拖放區域。ASP.net創建一個圖像

我:

一組具有X,Y的寬度和高度圖像的所有已知 一組文本標籤,所有與X,Y,字體大小,文本等所有已知

哪有我將其轉換爲圖像文件,以便我可以縮略圖?不知道從哪裏開始。

回答

1

創建一個您需要的大小的位圖,從中獲取圖形實例並開始繪製。

Bitmap bmp = new Bitmap(height,width); 
using gfx = Graphics.FromImage(bmp) { 
    // then draw on the gfx instance, flush, and then save the bitmap. 
    gfx.DrawString(...)//with your position information 
    gfx.DrawImage(...)//with your position,font,text info 
    gfx.Flush(); 
} 
bmp.Save(...);