5-Using Graphics in Calc
5-Using Graphics in Calc
Chapter 5
Using Graphics in Calc
Copyright
This document is Copyright © 2006–2012 by its contributors as listed below. You may distribute it
and/or modify it under the terms of either the GNU General Public License
(http://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative Commons Attribution
License (http://creativecommons.org/licenses/by/3.0/), version 3.0 or later.
All trademarks within this guide belong to their legitimate owners.
Contributors
Barbara Duprey
Jean Hollis Weber
John A Smith
Feedback
Please direct any comments or suggestions about this document to:
[email protected]
Acknowledgments
This chapter is based on Chapter 5 of the OpenOffice.org 3.3 Calc Guide. The contributors to that
chapter are:
Jean Hollis Weber Emma Kirsopp Peter Kupfer
Alexandre Martins Kashmira Patel Iain Roberts
The term graphics refers to both pictures and drawing objects. Often the word
Note images is used when referring to pictures and other graphics that are not drawing
objects.
2) Choose Insert > Picture > From File from the menu bar, or click the Insert Picture
icon on the Picture toolbar).
The picture is inserted into Calc floating above the cells and anchored to the cell in
Note which the cursor was placed. See “Positioning graphics” on page 18 for more about
positioning and anchoring graphics.
At the bottom of the dialog are two options, Preview and Link. Select Preview to view a thumbnail
of the selected image on the right, so you can verify that you have the correct file. The Link option
is discussed on page 5. When the Link option is not selected, the picture is embedded in the Calc
document.
Your Insert Picture dialog may look quite different from the one shown here,
Note depending on your operating system and your choice in Tools > Options >
LibreOffice > General of whether to use the LibreOffice Open and Save dialogs.
When inserting the same image several times in the document, it might appear
beneficial to create links. However, this is not necessary, as LibreOffice embeds
Note only one copy of the image file in the document. (Deleting one or more of the
copies does not affect the others.)
Caution
If the application from which the graphic was copied is closed before the graphic is
pasted into Calc, the image stored on the clipboard could be lost from the clipboard.
1) To open the Gallery (Figure 3), click on the Gallery icon (located in the right side of the
Standard toolbar) or choose Tools > Gallery from the menu bar.
2) Navigate through the Gallery to find the desired picture.
3) To insert the picture, either right-click on the picture and choose Insert > Copy or click and
drag the picture from the Gallery into the Calc document.
By default, the Gallery is docked above the Calc workspace. To expand the Gallery, position the
pointer over the line that divides it from the top of the workspace. When the pointer changes to
parallel lines with arrows, click and drag downward. The workspace resizes in response.
To expand the Gallery without affecting the workspace, undock it so it floats over the workspace.
To do so, hold down the Control key and double-click on the upper part of the Gallery next to the
View icons. Double-click in the same area while holding down the Control key to dock it again
(restore it to its position over the workspace).
When the Gallery is docked, to hide it and view the full Calc workspace, click the Hide/Show
button in the middle of the thin bar separating the Gallery from the workspace (circled in Figure 3).
To close the Gallery, choose Tools > Gallery to uncheck the Gallery entry, or click on the Gallery
icon again.
Modifying images
When you insert a new image, you may need to modify it to suit the document. This section
describes the use of the Picture toolbar, resizing, cropping, and a workaround for rotating a picture.
Changes made in Calc do not affect the original picture, whether it is embedded or linked.
Calc provides many tools for working with images. These tools are sufficient for most people’s
everyday requirements. However, for professional results it is generally better to use an image
manipulation program such as GIMP to modify images (for example, to crop, resize, rotate, and
change color values) and then insert the result into Calc. GIMP is an open-source graphics
program that can be downloaded from http://www.gimp.org/downloads/.
Modifying images 9
Choosing a graphics mode
You can change color images to grayscale by selecting the image and then selecting Grayscale
from the Graphics mode list.
Click the Filter icon to display the Graphic Filter toolbar, which provides
options for applying basic photographic and effect filters to images from within
Calc. To “tear off” this toolbar and place it anywhere on the screen, click on the
three parallel lines and drag it away.
Remove
Applies crude noise reduction.
Noise
Reverses a portion of the tones, then produces pronounced outlines of
Solarization
the highlights.
Charcoal
Applies a Charcoal Sketch look to the image.
Sketch
Displays a dialog for creating reliefs. The position of the imaginary light
Relief
source that determines the type of shadow can be chosen.
Joins small groups of pixels into rectangular areas of the same color.
Mosaic The larger the individual rectangles are, the fewer details the graphic
image has.
Adjusting colors
Use the Color toolbar to adjust an image’s red, green, and blue channels
independently, as well as its brightness, contrast and gamma.
Setting transparency
Cropping pictures
When you are only interested in a section of the image for the purpose of your document, you may
wish to crop (hide) parts of it. If you wish to remove (delete) areas of the image it may be a better
choice to use a graphics package.
Click the Crop icon to open a dialog where you can select which portion of the image you
want to remove from view.
It is not possible to use the mouse to select the area to be cropped, as you can in Draw. Instead, in
the Crop dialog, specify how far from the top, bottom, left and right borders of the image the crop
should be, as illustrated in Figure 5. On the thumbnail in the figure, notice that the cropped
selection is highlighted with an inner rectangle.
On the Crop dialog, you can control the following parameters:
Keep scale / Keep image size
When Keep scale is selected (default), cropping the image does not change the scale of the
picture.
When Keep image size is selected, cropping enlarges (for positive cropping values), shrinks
(for negative cropping values), or distorts of the image so that the image size remains constant.
Modifying images 11
• When Keep image size is selected, the remaining part of the image is enlarged (when you
enter positive values for cropping) or shrunk (when you enter negative values for cropping)
so that the width and height of the image is not changed.
If you crop an image in Calc, the picture itself is not affected. Only the area
Note displayed is altered. If you export the document to HTML, the full original image is
exported, not the cropped image.
Resizing an image
To resize an image:
1) Click the picture, if necessary, to show the green resizing handles.
2) Position the pointer over one of the green resizing handles. The pointer changes shape
giving a graphical representation of the direction of the resizing.
3) Click and drag to resize the picture.
4) Release the mouse button when satisfied with the new size.
The corner handles resize both the width and the height of the graphic object simultaneously, while
the other four handles only resize one dimension at a time.
To retain the original proportions of the graphic, Shift+click one of the corner
Tip handles, then drag. Be sure to release the mouse button before releasing the Shift
key.
Rotating a picture
Select the image, then choose Format > Graphic > Position and Size from the Menu bar, or
right-click the image and select Position and Size from the context menu.
1) Select the Rotation tab on the dialog (Figure 6).
2) In the Pivot point section of the page, select the x-y co-ordinates of the pivot point, from the
left and top edges, using the spin box settings, or set the pivot point in one of the default
positions shown in the selection graphic.
3) In the Rotation angle section, either set the rotation angle in the Angle spin box, or select
one of the 45 degree defaults shown in the selection graphic.
4) If you change your mind, click the Reset button to return the settings to what they were
when the dialog opened.
5) Click OK to rotate the image.
Text
Opens a dialog where you can set the options for text that goes over a picture. To write text over a
graphic, click on the graphic to select it, and then press Enter. There should be a cursor inside the
graphic. Any text entered is part of the graphic, so if the graphic is moved the text will move with it.
Original Size
Resets the dimensions of the image to the values when it was originally inserted into the
document.
Description
You can add metadata in the form of a title and description to the image. This information is used
by accessibility tools (such as screen reader software) and as ALT (alternative) attributes if you
export the document to HTML.
Name
You can add a custom name to be assigned to the image, to make it easier to find in the Navigator.
Flip
Flips the image either horizontally or vertically.
Assign Macro
Adds programmable functionality to the image. Calc provides rich macro functionality. Macros are
introduced in Chapter 12, Calc Macros.
After images are grouped, the context menu provides other choices (Ungroup and Edit Group)
and the Format > Group menu includes Ungroup and Enter Group. For more information about
grouping, see the Draw Guide.
Fontwork Gallery
Opens the Fontwork Gallery.
To display other icons, click the down-arrow at the right-hand end of the toolbar, select Visible
Buttons, and then choose the tools you want to appear on the toolbar.
Positioning graphics
Graphics can be positioned in LibreOffice Calc to work together and build more complex features.
Arranging graphics
Graphics in a Calc document are maintained in a similar manner to a deck of cards. As you add
more images to the document, each image occupies a new layer at the top of the stack. To arrange
graphics, you tell Calc to change the order of layers in the stack.
Bring to Front
Places the image on top of any other graphics or text.
Bring Forward
Brings the image one level up in the stack (z-axis). Depending on the number of overlapping
objects, you may need to apply this option several times to obtain the desired result.
Send Backward
The opposite of Bring Forward; sends the selected image one level down in the object stack.
Send to Back
Sends the selected graphic to the bottom of the stack, so that other graphics and text cover it.
Anchoring graphics
Anchors tell a graphic where to stay in relation to other items.
Anchor to page
Anchoring a graphic to the page allows it to be positioned in a specific place on the page. The
graphic does not move when cells are added or deleted. This is equivalent to an absolute
reference. The graphic will always stay by cell B10 if that is where it is placed.
Anchor to cell
Anchoring a graphic to a cell ensures that the graphic always stays with the content it is
originally anchored to. If a graphic is anchored to cell B10, and a new row is inserted, the
graphic will then be anchored to cell B11. This is equivalent to a relative reference.
For example, in Figure 11 the picture on the left is anchored To Cell B2 (XXX shows where the
picture is anchored). The picture on the right is anchored to the page.
Positioning graphics 19
If two rows are inserted above the pictures, the picture anchored to a cell will shift down two rows
and the anchor will change. The picture anchored to the page will not move. This is illustrated in
Figure 12. Note that the anchor symbol and the XXX have moved down to cell B4.
Aligning graphics
You can align several graphics relative to each other. To do this:
1) Select all of the graphics to be aligned (Shift+click on each in turn). The graphics will be
surrounded by an invisible bounding box with 8 green handles.
2) On the Picture toolbar, click on the Alignment icon and select one of the six options.
Or, position the mouse pointer over any of the graphics. When the pointer changes shape
from an arrow to a hand, right-click and choose Alignment, then select from the six
options.
The six options include three for aligning the graphics horizontally (left, center, right) and three for
aligning the graphics vertically (top, center, bottom).
5) When done, click the Save icon to save the imagemap to a file, then click the X in the
upper right corner to close the dialog.
The value _self for the target frame will work just fine in the vast majority of
Tip occasions. It is therefore not recommended to use the other choices unless
absolutely necessary.