/** * Accessor for the anchor properties */ public virtual void setImageAnchor(ImageAnchorProperties iap) { imageAnchorProperties = iap; if (origin == Origin.READ) { origin = Origin.READ_WRITE; } }
/** * Constructor invoked when writing the images * * @param x the column * @param y the row * @param w the width in cells * @param h the height in cells * @param image the image data */ public Drawing(double x, double y, double w, double h, byte[] image) { imageData = image; initialized = true; origin = Origin.WRITE; this.x = x; this.y = y; this.width = w; this.height = h; referenceCount = 1; imageAnchorProperties = MOVE_WITH_CELLS; type = ShapeType.PICTURE_FRAME; }
public static ImageAnchorProperties getImageAnchorProperties(int val) { ImageAnchorProperties iap = MOVE_AND_SIZE_WITH_CELLS; int pos = 0; while (pos < o.Length) { if (o[pos].getValue() == val) { iap = o[pos]; break; } else { pos++; } } return(iap); }
/** * Accessor for the anchor properties */ public override void setImageAnchor(ImageAnchorProperties iap) { base.setImageAnchor(iap); }
/** * Initializes the member variables from the Escher stream data */ private void initialize() { readSpContainer = drawingData.getSpContainer(drawingNumber); Assert.verify(readSpContainer != null); EscherRecord[] children = readSpContainer.getChildren(); Sp sp = (Sp)readSpContainer.getChildren()[0]; shapeId = sp.getShapeId(); objectId = objRecord.getObjectId(); type = ShapeType.getType(sp.getShapeType()); if (type == ShapeType.UNKNOWN) { //logger.warn("Unknown shape type"); } Opt opt = (Opt)readSpContainer.getChildren()[1]; if (opt.getProperty(260) != null) { blipId = opt.getProperty(260).value; } if (opt.getProperty(261) != null) { imageFile = new System.IO.FileInfo(opt.getProperty(261).StringValue); } else { if (type == ShapeType.PICTURE_FRAME) { //logger.warn("no filename property for drawing"); imageFile = new System.IO.FileInfo(blipId.ToString().Trim()); } } ClientAnchor clientAnchor = null; for (int i = 0; i < children.Length && clientAnchor == null; i++) { if (children[i].getType() == EscherRecordType.CLIENT_ANCHOR) { clientAnchor = (ClientAnchor)children[i]; } } if (clientAnchor == null) { //logger.warn("client anchor not found"); } else { x = clientAnchor.getX1(); y = clientAnchor.getY1(); width = clientAnchor.getX2() - x; height = clientAnchor.getY2() - y; imageAnchorProperties = ImageAnchorProperties.getImageAnchorProperties(clientAnchor.getProperties()); } if (blipId == 0) { //logger.warn("linked drawings are not supported"); } initialized = true; }
/** * Accessor for the anchor properties */ public virtual void setImageAnchor(ImageAnchorProperties iap) { imageAnchorProperties = iap; if (origin == Origin.READ) origin = Origin.READ_WRITE; }
/** * Constructor invoked when writing the images * * @param x the column * @param y the row * @param w the width in cells * @param h the height in cells * @param image the image data */ public Drawing(double x, double y, double w, double h, byte[] image) { imageData = image; initialized = true; origin = Origin.WRITE; this.x = x; this.y = y; this.width = w; this.height = h; referenceCount = 1; imageAnchorProperties = MOVE_WITH_CELLS; type = ShapeType.PICTURE_FRAME; }
/** * Initializes the member variables from the Escher stream data */ private void initialize() { readSpContainer = drawingData.getSpContainer(drawingNumber); Assert.verify(readSpContainer != null); EscherRecord[] children = readSpContainer.getChildren(); Sp sp = (Sp)readSpContainer.getChildren()[0]; shapeId = sp.getShapeId(); objectId = objRecord.getObjectId(); type = ShapeType.getType(sp.getShapeType()); if (type == ShapeType.UNKNOWN) { //logger.warn("Unknown shape type"); } Opt opt = (Opt)readSpContainer.getChildren()[1]; if (opt.getProperty(260) != null) blipId = opt.getProperty(260).value; if (opt.getProperty(261) != null) imageFile = new System.IO.FileInfo(opt.getProperty(261).StringValue); else { if (type == ShapeType.PICTURE_FRAME) { //logger.warn("no filename property for drawing"); imageFile = new System.IO.FileInfo(blipId.ToString().Trim()); } } ClientAnchor clientAnchor = null; for (int i = 0; i < children.Length && clientAnchor == null; i++) { if (children[i].getType() == EscherRecordType.CLIENT_ANCHOR) clientAnchor = (ClientAnchor)children[i]; } if (clientAnchor == null) { //logger.warn("client anchor not found"); } else { x = clientAnchor.getX1(); y = clientAnchor.getY1(); width = clientAnchor.getX2() - x; height = clientAnchor.getY2() - y; imageAnchorProperties = ImageAnchorProperties.getImageAnchorProperties(clientAnchor.getProperties()); } if (blipId == 0) { //logger.warn("linked drawings are not supported"); } initialized = true; }
/** * Accessor for the anchor properties */ public override void setImageAnchor(ImageAnchorProperties iap) { base.setImageAnchor(iap); }