Presentation is loading. Please wait.

Presentation is loading. Please wait.

Open XML Developer Workshop DrawingML Basics. Open XML Developer Workshop Disclaimer The information contained in this slide deck represents the current.

Similar presentations


Presentation on theme: "Open XML Developer Workshop DrawingML Basics. Open XML Developer Workshop Disclaimer The information contained in this slide deck represents the current."— Presentation transcript:

1 Open XML Developer Workshop DrawingML Basics

2 Open XML Developer Workshop Disclaimer The information contained in this slide deck represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This slide deck is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this slide deck may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this slide deck. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this slide deck does not give you any license to these patents, trademarks, copyrights, or other intellectual property. Unless otherwise noted, the example companies, organizations, products, domain names, addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, address, logo, person, place or event is intended or should be inferred. © 2006 Microsoft Corporation. All rights reserved. Microsoft, 2007 Microsoft Office System,.NET Framework 3.0, Visual Studio, and Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

3 Open XML Developer Workshop Tip of a Large Iceberg

4 Open XML Developer Workshop SHAPES, PICTURES, GRAPHIC FRAMES, CHARTS

5 Open XML Developer Workshop DrawingML General Concepts 5 Main types of objects Shape Group Shape Connector Picture Graphic Frame General-purpose container Used for Charts, Diagrams, Tables Most widely used elements are Property elements Non-Visible Properties (nvPrs): union of common nvPrs and object specific nvPrs Visible Properties: object specific

6 Open XML Developer Workshop DrawingML Coordinate System Measured in EMU (English Metrical Unit) 914,400 EMU per inch 12,700 EMU in a point 360,000 EMU per cm

7 Open XML Developer Workshop SHAPES

8 Open XML Developer Workshop Shapes Preset geometry Pick the preset shape Specify the adjust values for the shape Text geometry Pick the preset text shape Specify the adjust values for the text shape Custom geometry Not covered in this course spTree nvGrpSpPrgrpSpPrsp nvSpPrspPr xfrmgeo fillPropertieslineProperties effectPropertiesscene3D sp3DbwMode styletxBody

9 Open XML Developer Workshop Shape Line and Fill Properties Indicates relationship id to image data BLIP (Binary Large Image or Pictures) Fill Gradient Fill Dash Line and Solid Fill Fill Dashed Line DEMO Line... Gradient stop and color

10 Open XML Developer Workshop DrawingML Text Text is largely modeled after Word’s design Similar structures Similar naming conventions Different schemas We can apply all graphic effects to text Some limited to runs Some limited to paragraph... Reflective Text Text Effect

11 Open XML Developer Workshop 3-D 3-D Scene Definition Before Apply 3-D Scene Above Apply 3-D Bevels Adjust Material types DEMO

12 Open XML Developer Workshop PICTURES

13 Open XML Developer Workshop Pictures vs. Shapes 1.Single fill allowed 2.Borders grow in/outward 3.Must be done by app 4.Can have text attached 5.Can have shape properties 6.Shape specific UI enabled 1.Two overlaid fills allowed 2.Borders grow outward 3.Lock aspect ratio flag 4.Cannot have text attached 5.Can have shape properties 6.Picture specific UI enabled

14 Open XML Developer Workshop Defining a Picture Define a Picture: Source image rel. id Acts similar to a shape Non-Visual picture properties convey picture specific save properties Similar for Audio & Video

15 Open XML Developer Workshop Picture Properties 1.Multiple Fills Allows for two fills to be applied such as a picture and a color fill 2.Picture Borders Because of the nature of pictures the borders grow outwards rather than in/outwards 3.Lock Aspect Ratio Resizing a picture can be done with or without the aspect ratio locked

16 Open XML Developer Workshop GRAPHIC OBJECTS AND CHARTS

17 Open XML Developer Workshop Graphic Objects Graphic element represents a single graphical object GraphicData element and Uri attribute Specifies the namespace for the embedded content Tells the consumer how to interpret the graphicData Ability to render is application specific Office supports a set of specific URI values: … Graphic Object DEMO URI means chart follows

18 Open XML Developer Workshop Charts Overview Visualization of information Can be reused across applications / formats Rich chart types 11 types 2-dimensional and 3-dimensional DEMO ChartSwapping DEMO ChartSwapping

19 Open XML Developer Workshop Elements of a Chart Graphic Object definition References separate XML chart part Defined in DrawingML namespace Chart XML Part Visual representation of data. Includes a cache of data for chart. Includes formatting using DrawingML. Data Relationship External relationship to file, or Internal relationship to embedded spreadsheet Spreadsheets point to their own data. Chart Drawing Contains shapes and pictures drawn on chart XML Chart Part Graphic Object Data Source 1 n n 1 rId Chart Drawing 0,1 1 rId

20 Open XML Developer Workshop Main Elements of the Chart Part XML Namespace "http://schemas.openxmlformats.org/drawingml/2006/chart" ElementDescription Root node includes chart. Root element for the chart. If the chart is 3D, specifies the 3D view. Defines a layout and contains an element that defines the type of chart. The type of chart (Bar, Pie, etc.) Defines a series of data in the chart Category (axis) cache data (strings) Values cache data (numbers). Specifies the legend. Bar Chart specific values

21 Open XML Developer Workshop Chart Data Cache Structure PearsApplesLemons East West North South Series Values Categories Chart XML fragment Your code writes this XML to set chart data!

22 Open XML Developer Workshop Specifying Series Data Points Strings or numbers Literals or references Point values East West North South Sheet1!$A$2:$A$5 East West North South Sheet1!$B$2:$B$ String Literal String ReferenceNumber Reference

23 Open XML Developer Workshop INSERTING DRAWING OBJECTS INTO DOCUMENTS

24 Open XML Developer Workshop Inserting DrawingML Objects Overview Drawing Types Allowed Charts Diagrams Locked Canvases Viewed but not edited by host Pictures The core DrawingML is the same in all hosts Location varies by host Wordprocessing: main body Spreadsheet: drawing part Presentation: slide Packaging (“shim”) varies DEMO

25 Open XML Developer Workshop Drawings in WordprocessingML Shim defines anchor and flow Graphic object

26 Open XML Developer Workshop Drawings in SpreadsheetML Shim defines anchor and non-visual properties Graphic object

27 Open XML Developer Workshop Drawings in PresentationML No shim. The shape is in the tree Graphic object

28 Open XML Developer Workshop Inserting Drawings in WordprocessingML Documents

29 Open XML Developer Workshop...

30 Open XML Developer Workshop WordprocessingML Inline Objects The most basic type of DrawingML object placement is in line with text The object is displayed like a large character glyph

31 Open XML Developer Workshop WordprocessingML Floating Objects Floating objects are positioned on the page independent of text They can be positioned: Absolutely (e.g. 1” inside the top margin) Relatively (e.g. centered within the page margins) EMUs inside the column 635 EMUs below the paragraph

32 Open XML Developer Workshop ElementExampleDescription wrapNone The object is positioned on the document and text is not displaced around it wrapSquare The object is positioned on the document and an implied rectangle determines the wrapping extents wrapTight A wrapping polygon, defined and stored in the file, determines the text wrapping extents wrapThrough Similar to tight wrapping – but any indents in the wrap polygon can be filled with text wrapTopAndBot tom Text cannot wrap around either side of the object Floating Object Text Wrapping in WordML Five ways to specify how text flows around the object DEMO WP Anchoring DEMO WP Anchoring

33 Open XML Developer Workshop Shapes created in WordprocessingML use VML VML Namespace VML Elements

34 Open XML Developer Workshop Inserting DrawingML into Spreadsheet Documents

35 Open XML Developer Workshop Graphical Objects in SpreadsheetML Worksheet Drawings stored in Drawing Part Linked by Relationship ID. Root element: Anchoring properties (3 types) Absolute: One cell: Two cell: Drawing elements DEMO ShapesCharts Drawing Part Sheet 1 1 rId

36 Open XML Developer Workshop Absolute Anchoring Don’t move or size with cells Position explicitly specified Measured in EMUs Extents explicitly specified Measured in EMUs

37 Open XML Developer Workshop One Cell Anchoring Move with cells Position locked to single cell Position explicitly specified Measured in EMUs Extents explicitly specified Measured in EMUs

38 Open XML Developer Workshop Two Cell Anchoring Move and size with cells Position locked to cell range From position specified Measured in EMUs To position specified Measured in EMUs Sizing based on cell range DEMO

39 Open XML Developer Workshop


Download ppt "Open XML Developer Workshop DrawingML Basics. Open XML Developer Workshop Disclaimer The information contained in this slide deck represents the current."

Similar presentations


Ads by Google