![]() ![]() (Color.FromArgb(0xFF, 0xA5, 0xA5)) ĭim canvas As Shape = (, New RectangleF(1.5F, 1F, 6F, 1.5F))ĭim canvasItems As CanvasShapeCollection = canvas.CanvasItemsĭim shape1 As NestedShape = canvasItems.AddShape(ShapeGeometryPreset.Rectangle, New RectangleF(0F, 0F, 2F, 1.5F)) Var shape3 = canvasItems.AddShape(ShapeGeometryPreset.Parallelogram, new RectangleF(3.8f, 0f, 2f, 1.5f)) ![]() Var shape2 = canvasItems.AddPicture(DocumentImageSource.FromFile("Picture_Arrow.png"), new PointF(2.1f, 0.3f)) Var shape1 = canvasItems.AddShape(ShapeGeometryPreset.Rectangle, new RectangleF(0f, 0f, 2f, 1.5f)) Access the collection of canvas items. Shape canvas = (, new RectangleF(1.5f, 1f, 6f, 1.5f)) The example below adds a drawing canvas to the document. The collection’s Add methods allow you to add shapes and pictures to the canvas. Use the Shape.CanvasItems property to access the canvas item collection. The ShapeCollection.InsertCanvas method inserts a drawing canvas into a document. ![]() Use the following properties to determine whether a drawing object is a text box:ĭ returns true. = ĭim textBoxDocument As SubDocument = ĭim cp As CharacterProperties = textBoxDocument.BeginUpdateCharacters(, 4)Ĭp.ForeColor = SubDocument textBoxDocument = ĬharacterProperties cp = textBoxDocument.BeginUpdateCharacters(, 4) Ĭp.ForeColor = ĭim myTextBox As Shape = (, New RectangleF(1.5F, 1F, 1.5F, 0.5F)) Specify the text box background color. Picture.HorizontalAlignment = ShapeHorizontalAlignment.Center Picture.VerticalAlignment = ShapeVerticalAlignment.Top Picture.HorizontalAlignment = ShapeHorizontalAlignment.Center ĭim picture As Shape = (, DocumentImageSource.FromFile("Dog.png")) Shape picture = (, DocumentImageSource.FromFile("Dog.png")) The example below inserts a picture with rounded corners. JPEG File Interchange Format (*.jpg, *.jpeg).The RichEditControl supports the following image formats: Use the Shape.PictureFormat property to access picture settings. (Color.FromArgb(&HFF, &HEE, &HAD))īorder.Color = Color.FromArgb(&H4D, &H64, &H8D)Ĭall the ShapeCollection.InsertPicture method to insert a picture into a document. (Color.FromArgb(0xFF, 0圎E, 0xAD)) īorder.Color = Color.FromArgb(0x4D, 0圆4, 0x8D) ĭim document As Document = richEditControl.Documentĭocument.Unit = ĭim rectangle As Shape = (, ShapeGeometryPreset.Rectangle, New RectangleF(1.5F, 1F, 2F, 1.5F)) Shape rectangle = (, ShapeGeometryPreset.Rectangle, new RectangleF(1.5f, 1f, 2f, 1.5f)) Use the SubDocument.Shapes property to access a document’s collection of drawing objects: shapes, pictures, text boxes, charts, OLE objects, and ActiveX controls.ĭocument document = richEditControl.Document ĭocument.Unit = Right-click a shape and select More Layout Options… to invoke this dialog. Tab items allow users to format the shape, define its position, and specify how text wraps around the shape.Īdvanced shape properties are available in the Shape Layout Dialog. When a user selects a shape, the Picture Tools contextual tab appears. Users can move, resize, rotate, and delete existing shapes. It does not contain user interface elements to create other shape types. The Rich Text Editor allows users to insert pictures and text boxes only. The Rich Text Editor supports all shape types from simple lines and rectangles to shapes with advanced effects. The WinForms Rich Text Editor allows you to view, print, and export documents that contain shapes to PDF. Shapes, Pictures, and Other Graphic Objects in Rich Text Documents ![]()
0 Comments
Leave a Reply. |