翻譯|使用教程|編輯:況魚(yú)杰|2020-08-20 10:08:47.633|閱讀 379 次
概述:TX Text Control提供了非常強(qiáng)大的圖形功能,可以將許多不同類(lèi)型的形狀插入文檔中。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門(mén)軟控件火熱銷(xiāo)售中 >>
相關(guān)鏈接:
Text Control GmbH公司的文檔處理控件功能強(qiáng)大,能幫助您輕松創(chuàng)建能與Microsoft Word功能媲美的應(yīng)用程序。
TX Text Control提供了非常強(qiáng)大的圖形功能,可以將許多不同類(lèi)型的形狀插入文檔中。 功能區(qū)的“插入”選項(xiàng)卡提供了開(kāi)箱即用的UI,可將形狀添加到文檔中:
添加單一形狀
為了以編程方式插入這些形狀,需要執(zhí)行幾個(gè)步驟:
// create a drawing control that contains the shape(s) TXTextControl.Drawing.TXDrawingControl drawing = new TXTextControl.Drawing.TXDrawingControl(3000, 3000); // create a new donut shape TXTextControl.Drawing.Shape shape = new TXTextControl.Drawing.Shape(TXTextControl.Drawing.ShapeType.Donut); // set the color and border width shape.ShapeFill.Color = Color.Red; shape.ShapeOutline.Color = Color.Yellow; shape.ShapeOutline.Width = 200; // add the shape to the drawing control drawing.Shapes.Add( shape, TXTextControl.Drawing.ShapeCollection.AddStyle.Fill); // create a new drawing frame object from the created drawing control TXTextControl.DataVisualization.DrawingFrame frame = new TXTextControl.DataVisualization.DrawingFrame(drawing); // add the frame to the document textControl1.Drawings.Add(frame, -1);
textControl1.Drawings.Add(frame, TXTextControl.FrameInsertionMode.DisplaceText);
添加容器組框架
以下代碼顯示了如何在組框架中插入更多形狀。 如果容器組框架被移動(dòng),則所有包含的形狀將一起移動(dòng):
// create a drawing control that contains the shape(s) TXTextControl.Drawing.TXDrawingControl drawingGroup = new TXTextControl.Drawing.TXDrawingControl(3000, 3000); // create a new donut shape TXTextControl.Drawing.Shape donut = new TXTextControl.Drawing.Shape(TXTextControl.Drawing.ShapeType.Donut) { Location = new Point(100, 100), Size = new Size(500,500) }; TXTextControl.Drawing.Shape diamond = new TXTextControl.Drawing.Shape(TXTextControl.Drawing.ShapeType.Diamond); // add the shape to the drawing control drawingGroup.Shapes.Add(donut); drawingGroup.Shapes.Add(diamond); // create a new drawing frame object from the created drawing control TXTextControl.DataVisualization.DrawingFrame frame = new TXTextControl.DataVisualization.DrawingFrame(drawingGroup); // add the frame to the document textControl1.Drawings.Add( frame, textControl1.InputPosition.Location, TXTextControl.FrameInsertionMode.DisplaceText);以下屏幕截圖顯示了已激活的組容器框架,其中插入了2個(gè)形狀:
向容器添加其他形狀
如果激活了容器框架(虛線(xiàn)邊框),則可以添加其他形狀。 以下代碼將新形狀插入到已激活的容器框架中:
// create a new donut shape TXTextControl.Drawing.Shape shape = new TXTextControl.Drawing.Shape(TXTextControl.Drawing.ShapeType.Donut); // set the color and border width shape.ShapeFill.Color = Color.Red; shape.ShapeOutline.Color = Color.Yellow; shape.ShapeOutline.Width = 200; if (textControl1.Drawings.GetActivatedItem() != null) { // add the shape to the drawing control ((TXDrawingControl)textControl1.Drawings.GetActivatedItem().Drawing).Shapes.Add(shape); }如果希望用戶(hù)將其他形狀繪制到容器中,則必須在Shapes.Add方法中使用MouseCreation成員。
((TXDrawingControl)textControl1.Drawings.GetActivatedItem().Drawing).Shapes.Add( shape, ShapeCollection.AddStyle.MouseCreation);
文章推薦:
TX Text Control系列教程— ASP.NET :創(chuàng)建文字處理器和模板設(shè)計(jì)器
如果您對(duì)Text Control感興趣,可以咨詢(xún)購(gòu)買(mǎi)正版授權(quán)軟件。
關(guān)注慧聚IT微信公眾號(hào) ???,了解產(chǎn)品的最新動(dòng)態(tài)及最新資訊。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: