Download presentation
Presentation is loading. Please wait.
Published byHope Ryan Modified over 9 years ago
1
Office Open XML Developer Workshop DrawingML Basics
2
Office 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, e-mail addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, email 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
Office Open XML Developer Workshop Tip of a Large Iceberg
4
Office 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
5
Office 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
6
Office Open XML Developer Workshop SHAPES
7
Office 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 DEMO
8
Office Open XML Developer Workshop Line and Fill Properties Indicates rel. id to image data BLIPs (Binary Large Image or Pictures) Fill Gradient Fill Dash Line and Solid Fill Line Dash Gradient
9
Office 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 ¶
10
Office Open XML Developer Workshop 3-D 3-D Scene Definition Before Apply 3-D Scene Above Apply 3-D Bevels Adjust Material types
11
Office Open XML Developer Workshop PICTURES
12
Office 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
13
Office Open XML Developer Workshop Defining a Picture Defines a Picture: Source image rel. id Acts much like a shape Non-Visual picture properties used to convey picture specific save properties
14
Office 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
15
Office Open XML Developer Workshop INSERTING DRAWINGML INTO DOCUMENTS
16
Office Open XML Developer Workshop DrawingML in DOCX/XLSX/PPTX Documents The core DrawingML definition is the same in each case Location varies (main body, drawing part, slide) Packaging (“shim”) varies Word:Excel:PowerPoint: DEMO
17
Office Open XML Developer Workshop WordprocessingML – document body Shim defines graphic frame and locked canvas Shape definition uses DrawingML namespace for all elements
18
Office Open XML Developer Workshop SpreadsheetML – drawing part Shim defines anchor position and type Shape definition uses spreadsheetDrawing namespace for non-visual properties
19
Office Open XML Developer Workshop PresentationML – slide part No shim – the shape is in the shape tree Shape definition is in DrawingML
20
Office Open XML Developer Workshop Graphical Objects in WordprocessingML Within a WordprocessingML document, it is possible to include several types of DrawingML objects: Charts Diagrams Locked Canvases Pictures Text DrawingML Diagram
21
Office Open XML Developer Workshop The graphicData Element Uri attribute specifies the namespace for the embedded content No child elements defined in the xsd – the uri tells the consumer how to interpret the graphicData Office supports a set of specific uri values: http://schemas.openxmlformats.org/drawingml/2006/chart http://schemas.openxmlformats.org/drawingml/2006/compatibility http://schemas.openxmlformats.org/drawingml/2006/diagram http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas http://schemas.openxmlformats.org/drawingml/2006/picture http://schemas.openxmlformats.org/drawingml/2006/table http://schemas.openxmlformats.org/drawingml/2006/ole
22
Office Open XML Developer Workshop DrawingML Object Positioning (Anchoring) Two ways to anchor in WordprocessingML: In line with text - The object is displayed within the regular text stream (modifying line height, etc. to accommodate it) Floating – The object is absolutely positioned within the document and text flow is modified as needed around it The type of anchoring is specified by the main element present in the document = in line with text = floating
23
Office Open XML Developer Workshop Inline Objects The most basic type of DrawingML object placement is in line with text The object is displayed like a large character glyph
24
Office Open XML Developer Workshop 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) 9525 EMUs inside the column 635EMUs below the paragraph
25
Office 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 Five ways to specify how text flows around the object
26
Office Open XML Developer Workshop Shapes in WordprocessingML use VML <w:document xmlns:w=http://schemas.openxmlformats.org/wordprocessingml/2006/mainhttp://schemas.openxmlformats.org/wordprocessingml/2006/main xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"...> The quick brown fox Legacy format
27
Office Open XML Developer Workshop Graphical Objects in SpreadsheetML Worksheet Drawings Anchoring properties (3 types) Absolute One cell Two cell Drawing elements
28
Office 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
29
Office 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
30
Office 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
31
Office Open XML Developer Workshop Example: Chart in a Spreadsheet 3 0 1 0 14 0 20 0 Two cell anchor Between C1 and N20 Chart object with r:id="rd123232" GraphicFrame to Hold chart object DEMO
32
Office Open XML Developer Workshop DIAGRAMS
33
Office Open XML Developer Workshop Diagrams (Smart Art) – not covered Built using Graphic Frame wrapper Diagrams built from four parts: Data Colors QuickStyles Layout
34
Office Open XML Developer Workshop MULTIMEDIA CONTENT
35
File Audio and Video Represented as picture shapes Three relationships One for hyperlink One for source bits One for picture uses icon image Configuration data stored in client data Path to source bits
36
Office Open XML Developer Workshop CHARTS DEMO
37
Office Open XML Developer Workshop Charts Chart Part Definition of the chart itself Includes a cache of data for chart Includes formatting using DrawingML Chart Drawing Contains shapes & pictures drawn on chart Data Relationship External relationship to file, or Internal relationship to embedded spreadsheet ML package Drawing ML Formatting Uses spPr for all lines, fills, and effects chartSpace chart titleview3Dlegend legendEntry walls & floorpivotFmt markerdLbl numFmt tx plotArea valAx areaChart catAx lineChart dateAx barChart serAx … dTable externalDatapivotSource...
38
Office Open XML Developer Workshop Chart Elements
39
Office Open XML Developer Workshop Example: 3D Chart Part ElementDescription chartSpace Root node includes chart and print definition. pivotSource If pivot table, identifies source table. chart Root element for the chart. view3D The chart is 3D, specifies the 3D view. plotArea Defines a layout and contains an element that defines the type of chart. pie3DChart This is a 3D pie chart. ser Specifies a series with categories and values. cat Category axis data (string cache). val Values, numbers shown (num cache). dLbls Settings for the data labels. Legend Specifies the legend.
40
Office Open XML Developer Workshop
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.