原創(chuàng)|其它|編輯:郝浩|2012-11-09 17:42:36.000|閱讀 287 次
概述:Aspose.Tasks提供根據(jù)不同時(shí)間尺度的設(shè)置來渲染甘特圖的功能。根據(jù)這些時(shí)間刻度設(shè)置(包括日,月,季度)有多個(gè)選項(xiàng)可用來渲染甘特圖圖像。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Aspose.Tasks提供根據(jù)不同時(shí)間尺度的設(shè)置來渲染甘特圖的功能。根據(jù)這些時(shí)間刻度設(shè)置(包括日,月,季度)有多個(gè)選項(xiàng)可用來渲染甘特圖圖像。使用這些選項(xiàng)可以將甘特圖渲染進(jìn)一張圖片中。本文詳細(xì)描述了這一過程。
ImageSaveOptions類的Timescale屬性決定了項(xiàng)目的Timescale時(shí)間尺度設(shè)置。這個(gè)時(shí)間尺度默認(rèn)為天,當(dāng)然也可使用月或著季度為單位。下面是代碼示例:
C# Project project = new ProjectReader().Read("NewProductDev.mpp"); // Save to one page image (Timescale.days by default) project.Save("NewProductDevDays.jpeg", new ImageSaveOptions(SaveFileFormat.JPEG)); // Save to one page image (Timescale.ThirdsOfMonths) ImageSaveOptions options = new ImageSaveOptions(SaveFileFormat.JPEG); options.Timescale = Timescale.ThirdsOfMonths; project.Save("NewProductDevThirdsOfMonths.jpeg", options); // Save to one page image (Timescale.Months) options.Timescale = Timescale.Months; project.Save("NewProductDevMonths.jpeg", options); // There is IRender property for compliance with Project.Export interface options.RenderParam = new BaseImageRenderParam(null, Point.Empty, new Size(800, 600), 100, 0, true); project.Save("NewProductDevRenderOptions.jpeg", options); VB.NET Dim project As Project = New ProjectReader().Read("NewProductDev.mpp") 'Save to one page image (Timescale.days by default) project.Save("NewProductDevDays.jpeg", New ImageSaveOptions(SaveFileFormat.JPEG)) 'Save to one page image (Timescale.ThirdsOfMonths) Dim options As ImageSaveOptions = New ImageSaveOptions(SaveFileFormat.JPEG) options.Timescale = Timescale.ThirdsOfMonths project.Save("NewProductDevThirdsOfMonths.jpeg", options) 'Save to one page image (Timescale.Months) options.Timescale = Timescale.Months project.Save("NewProductDevMonths.jpeg", options) 'There is IRender property for compliance with Project.Export interface Dim baseImageRenderParam As BaseImageRenderParam = New BaseImageRenderParam(Nothing, Point.Empty, New Size(800, 600), 100, 0, True) project.Save("NewProductDevRenderOptions.jpeg", options)
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件網(wǎng)