<chapter id="creatingpatterns" >
    <title>Creating patterns</title>

    <sect1 id="starting-kxstitch">
        <title>Starting &kxstitch;</title>
        <para>
            When starting &kxstitch; you will be presented with a blank canvas of the default
            size. This is also the case when selecting <menuchoice><guimenu>File</guimenu><guimenuitem>New</guimenuitem></menuchoice>.
            The default sizes can be set in the pattern properties dialog by enabling the set as default checkbox.
        </para>
        <para>
            If the default size is not suitable for your planned pattern, you can use
            the <menuchoice><guimenu>File</guimenu><guimenuitem>File Properties</guimenuitem></menuchoice> dialog to change it.
            Adjust the values as required and after clicking on <guibutton>OK</guibutton>, the pattern will be resized to suit.
        </para>
        <para>
            Before creating a pattern you will need to add some flosses to the palette using the <menuchoice><guimenu>Palette</guimenu>
            <guimenuitem>Palette Manager</guimenuitem></menuchoice>. This will enable the tools in the <menuchoice><guimenu>Tools</guimenu></menuchoice> menu and toolbar.
            See the <link linkend="PaletteManagerDialog">Palette Manager Dialog</link> for further information.
        </para>
    </sect1>

    <sect1 id="importing-images">
        <title>Importing Images</title>
        <para>
            &kxstitch; allows you to import an image. A dialog will be displayed that previews the
            image based on the default import options.
        </para>
        <para>
            The initial size of the pattern will be based on the default pattern size.
        </para>
        <para>
            Options for importing allow you to change the floss scheme used and to limit the
            number of colors. You can also change the scaling to reduce or enlarge the final
            pattern.
        </para>
        <para>
            Checking the <guilabel>Use fractionals</guilabel> checkbox will enable the use of fractional stitches to give more
            detail for any given pattern size.
        </para>
        <para>
            Checking the <guilabel>Ignore color</guilabel> checkbox will allow the selection of a color within the image which will then be considered
            as the transparent color and ignored during the import.
        </para>
        <para>
            After the image has been imported, an additional dock window will be available giving a preview of the original
            image without any color transitions.
        </para>
    </sect1>

    <sect1 id="background-images">
        <title>Background Images</title>
        <para>
            You can insert an image as a background to the editor window. This is useful if importing
            the image is not desirable or gives poor results.
        </para>
        <para>
            The image is normally scaled to cover the entire pattern grid. This may not be suitable, therefore
            you can use the select tool to select an area that you want to cover and then select the
            <menuchoice><guimenu>View</guimenu> <guimenuitem>Fit Background Image to Selection</guimenuitem></menuchoice>. This will
            rescale the image to fit within the selected area. You can continue doing this until you are happy
            with the result, even after you have started adding stitches.
        </para>
        <para>
            There is no limit to the number of background images that can be added. Although practical limits of the menus will
            determine how many can be added. The background images are stored within the document, so they will be available when
            the pattern is reloaded.
        </para>
    </sect1>

    <sect1 id="pattern-libraries">
        <title>Pattern Libraries</title>
        <para>
            The pattern library manager can be used to store patterns for insertion into the working pattern.  They can be categorized into
            a hierarchy of categories and subcategories with multiple root nodes in the library list.  The Alphabet tool makes use of these libraries
            to provide an alphabet of insertable characters that can be assigned an associated key.
        </para>
        <para>
            The library manager is a non modal dialog and can be left open whilst working on your pattern.  You can select different libraries as
            needed and then drag and drop library patterns onto the working pattern.
        </para>
        <para>
            Adding new category headings can be done with a &RMB; on either an existing entry, to create a sub category, or on a blank space on
            the library list, to create a new root entry, and selecting the <guimenuitem>New Category</guimenuitem> option.  Enter the name of the category and click <guibutton>OK</guibutton>.
        </para>
        <para>
            Creating a new library pattern is done by selecting an area of your working pattern, copying and pasting to one of the existing categories.
        </para>
        <para>
            Each library pattern has properties, accessed by its context menu.  These properties include size, floss scheme, baseline value and associated key.
            The baseline value is used by the Alphabet tool to adjust the height of a character above, negative values, or below the insertion point.
            The associated key is again used by the Alphabet tool to match with the key pressed on the keyboard.
        </para>
    </sect1>
</chapter>
