Documentation
¶
Overview ¶
These elements encompass the definition of pictures within the DrawingML framework. While pictures are in many ways very similar to shapes they have specific properties that are unique in order to optimize for picture-specific scenarios. Some of these properties include Fill behavior, Border behavior and Resize behavior.
Index ¶
Constants ¶
View Source
const ( BlackWhiteModeClr = "clr" BlackWhiteModeAuto = "auto" BlackWhiteModeGray = "gray" BlackWhiteModeLtGray = "ltGray" BlackWhiteModeInvGray = "invGray" BlackWhiteModeGrayWhite = "grayWhite" BlackWhiteModeBlackGray = "blackGray" BlackWhiteModeBlackWhite = "blackWhite" BlackWhiteModeBlack = "black" BlackWhiteModeWhite = "white" BlackWhiteModeHidden = "hidden" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blip ¶
type Blip struct {
EmbedID string `xml:"embed,attr,omitempty"`
}
Binary large image or picture
func (Blip) MarshalXML ¶
type BlipFill ¶
type BlipFill struct {
// 1. Blip
Blip *Blip `xml:"blip,omitempty"`
//2.Source Rectangle
SrcRect *dmlct.RelativeRect `xml:"srcRect,omitempty"`
// 3. Choice of a:EG_FillModeProperties
FillModeProps FillModeProps `xml:",any"`
//Attributes:
DPI *uint32 `xml:"dpi,attr,omitempty"` //DPI Setting
RotWithShape *bool `xml:"rotWithShape,attr,omitempty"` //Rotate With Shape
}
func NewBlipFill ¶
NewBlipFill creates a new BlipFill with the given relationship ID (rID) The rID is used to reference the image in the presentation.
func (BlipFill) MarshalXML ¶
type CNvPicPr ¶
type CNvPicPr struct {
//Relative Resize Preferred - Default value is "true"(i.e when attr not specified).
PreferRelativeResize *bool `xml:"preferRelativeResize,attr,omitempty"`
//1. Picture Locks
PicLocks *dmlprops.PicLocks `xml:"picLocks,omitempty"`
}
Non-Visual Picture Drawing Properties
func NewCNvPicPr ¶
func NewCNvPicPr() CNvPicPr
func (CNvPicPr) MarshalXML ¶
type FillModeProps ¶
type FillModeProps struct {
Stretch *shapes.Stretch `xml:"stretch,omitempty"`
Tile *shapes.Tile `xml:"tile,omitempty"`
}
func (FillModeProps) MarshalXML ¶
func (f FillModeProps) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type NonVisualPicProp ¶
type NonVisualPicProp struct {
// 1. Non-Visual Drawing Properties
CNvPr dmlct.CNvPr `xml:"cNvPr,omitempty"`
// 2.Non-Visual Picture Drawing Properties
CNvPicPr CNvPicPr `xml:"cNvPicPr,omitempty"`
}
Non-Visual Picture Properties
func DefaultNVPicProp ¶
func DefaultNVPicProp(id uint, name string) NonVisualPicProp
func NewNVPicProp ¶
func NewNVPicProp(cNvPr dmlct.CNvPr, cNvPicPr CNvPicPr) NonVisualPicProp
func (NonVisualPicProp) MarshalXML ¶
func (n NonVisualPicProp) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type Offset ¶
func (Offset) MarshalXML ¶
type Pic ¶
type Pic struct {
// 1. Non-Visual Picture Properties
NonVisualPicProp NonVisualPicProp `xml:"nvPicPr,omitempty"`
// 2.Picture Fill
BlipFill BlipFill `xml:"blipFill,omitempty"`
// 3.Shape Properties
PicShapeProp PicShapeProp `xml:"spPr,omitempty"`
}
func (Pic) MarshalXML ¶
type PicShapeProp ¶
type PicShapeProp struct {
// -- Attributes --
//Black and White Mode
BwMode *string `xml:"bwMode,attr,omitempty"`
// -- Child Elements --
//1.2D Transform for Individual Objects
TransformGroup *TransformGroup `xml:"xfrm,omitempty"`
// 2. Choice
//TODO: Modify it as Geometry choice
PresetGeometry *PresetGeometry `xml:"prstGeom,omitempty"`
}
func NewPicShapeProp ¶
func NewPicShapeProp(options ...PicShapePropOption) *PicShapeProp
func (PicShapeProp) MarshalXML ¶
func (p PicShapeProp) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type PicShapePropOption ¶
type PicShapePropOption func(*PicShapeProp)
func WithPrstGeom ¶
func WithPrstGeom(preset string) PicShapePropOption
func WithTransformGroup ¶
func WithTransformGroup(options ...TFGroupOption) PicShapePropOption
type PresetGeometry ¶
type PresetGeometry struct {
Preset string `xml:"prst,attr,omitempty"`
AdjustValues *geom.AdjustValues `xml:"avLst,omitempty"`
}
func NewPresetGeom ¶
func NewPresetGeom(preset string) *PresetGeometry
func (PresetGeometry) MarshalXML ¶
func (p PresetGeometry) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type TFGroupOption ¶
type TFGroupOption func(*TransformGroup)
func WithTFExtent ¶
func WithTFExtent(width units.Emu, height units.Emu) TFGroupOption
type TransformGroup ¶
type TransformGroup struct {
Extent *dmlct.PSize2D `xml:"ext,omitempty"`
Offset *Offset `xml:"off,omitempty"`
}
func NewTransformGroup ¶
func NewTransformGroup(options ...TFGroupOption) *TransformGroup
func (TransformGroup) MarshalXML ¶
func (t TransformGroup) MarshalXML(e *xml.Encoder, start xml.StartElement) error
Click to show internal directories.
Click to hide internal directories.