SqlImages configuration settings reference

There are many attributes in this config section. It is worth to make the steps to achive Intellisense in your config file for this section.

Sample config

<sqlImages>
  <blobEntries defaultFontFamily="Lucida Handwriting">
    <add key="sample" image="nalogo.png" backgroundColor="White" textVerticalAlignment="Bottom" borderColor="Black" padding="5,5,5,25" />
    <add key="empty" basedOn="sample" borderThickness="0.5" />
  </blobEntries>
</sqlImages>

configuration/sqlImages/blobEntries

The collection node of the SqlImages properties with some default values for the child add items. It can have any number of child add item.

attribute type sample value description
defaultConnectionStringName string CatalogDBConnection This is a reference to one of the connection string entries in the ConnectionStrings collection of the configuration. Used by the child add elements when they have command attribute but does not have connectionStringName attribute
defaultImagesBasePath path ~/Contents The child elements have an image and a watermark attribute either on is a path to an image. This is the basepath for those paths if they are relative paths and the add item has no imagesBasePath attribute.
defaultFontFamily string Times New Roman This is the font's name for the rendered text if a child element does not have a fontFamily attribute.
defaultFontSize decimal number 30.5 This is the default font size in WPF units (let's say in pixels) for the add elements that have no fontSize attribute.

configuration/sqlImages/blobEntries/add

Visual style properties for an image rendering task with SqlImage

infrastructural attributes

attribute type sample value description
key string highlightedButton Required identity. Used by SqlImage methods
imageBackgroundColor Color #FFAA00 Defaults to Transparent. The color of the background of the whole image. It is useful when you choose jpeg format.
imageFormat ImageFormat Png Defaults to Png. It is the format of the generated image.
imagesBasePath path ~/Contents If you give the image or the watermark attribute as a relative path, this will be their base path. This path can be a relative to the application's root as in this example or can be an absolute path in your harddrives or in the web.
command string dbo.getMyData This is a stored procedure name. It can have parameters. If it has then you can give those parameters with the SqlImage methods. It will be executed on the connection the connectionStringName provides. The returning record (the first record if there are more than one) will be used to override these settings. You just have to return columns of your choice and named like these attributes. There is an exceptional attribute, the image. You can return an image path with a column name ImageUrl (it can be relative or absolute) or you can return the image bytes with a blob field with the name of ImageBytes.
connectionStringName string MyDatabaseConnection Required if command is not empty. This is a reference to one of the connection string entries in the ConnectionStrings collection of the configuration. Used to execute the command.
basedOn string button This is a reference to an other add element in the tacepao/properties list. The given elements attributes will be used if this element has no value for them.

border and background attributes

attribute type sample value description
borderColor Color #FFAA00 Defaults to Transparent. The color of the outer border.
borderThickness Thickness 5,10,5,8 Defaults to 0. The thickness of the outer border's sides.
cornerRadius CornerRadius 5 Defaults to 0. The radius of the border's corners.
backgroundColor Color Green Defaults to Transparent. You can fill the background with a linear gradient from top to bottom. This is the middle color of the gradient. It is the default value for the darkColor and the light color too.
padding Thickness 5,10,5,8 Defaults to 0. The space between the outer border and the inner border.
margin Thickness 5,10,5,8 Defaults to 0. The space between the border and the edge of the generated image. Outside the border there will be a transparent area on the generated png. If you use background color and shadow there must be enough space in this area for the shadow to be on the image.
innerBorderColor Color Green Defaults, to Transparent. There are two borders around the picture. This is the color of the inner border.
innerBorderThickness Thickness 2,1 Defaults to 0. The thickness of the inner border.
innerCornerRadius CornerRadius 5,10,5,8 Defaults to 0. The radius of the corners of the inner border.
innerBackgroundColor Color White Defaults to Transparent. The color of the inner border's background.
innerPadding Thickness 0 Defaults to 0. The space between the inner border and the picture.

image and watermark attributes

attribute type sample value description
image path nalogo.png A path to an image to be used.
imageWidth decimal 50.7 The explicit width for the referenced image. This image can be smaller than this value if the imageHeight is used too because there will be a proportional resizing. If neither value have been given, then the image original size will be used.
imageHeight decimal 30.7 The explicit height for the image. This image can be smaller than this value if the imageWidth is used too because there will be a proportional resizing. If neither value have been given, then the image original size will be used.
imageHorizontalAlignment HorizontalAlignment
imageVerticalAlignment VerticalAlignment
watermark path watermark.png A path to an image for watermark.
watermarkWidth decimal 10.2 Defaults to null. The explicit width for the referenced watermark image. This image can be smaller than this value if the imageHeight is used too because there will be a proportional resizing. If neither value have been given, then the image original size will be used.
watermarkHeight decimal 8.3 Defaults to null. The explicit height for the watermark image. This image can be smaller than this value if the imageWidth is used too because there will be a proportional resizing. If neither value have been given, then the image original size will be used.
watermarkHorizontalAlignment HorizontalAlignment
watermarkVerticalAlignment VerticalAlignment
watermarkMargin Thickness
watermarkOpacity decimal

text attributes

attribute type sample value description
foreColor Color Black Defaults to Black. Color for the text.
fontFamily string Times New Roman The name of the font to be uset for the text. If it is empty or an invalid name, then the system's default font will be used.
fontSize decimal 25.7 The size of the font used for the text. I fit is emty or invalid, then the WPF's default size will be used.
fontWeight FontWeight Bold Defaults to Normal.
fontStyle FontStyle Italic Defaults to Normal.
fontStretch FontStretch Normal Defaults to Normal.
textHorizontalAlignment HorizontalAlignment
textVerticalAlignment VerticalAlignment
textMargin Thickness

shadow attributes

attribute type sample value description
shadowColor Color Black Defaults to black. The color of the shadow for the whole image. The shadow will be rendered only if the shadowOpacity is greater than 0. There must be enough space around the image to see the sahdow. This can be achive with the margin attribute.
shadowOpacity decimal 0.7 Defaults to 0. 1 means full opaque and 0 means full transparent.
shadowBlurRadius decimal 5.7 How strong the shadow blur have to be.
shadowDirection decimal 30.7 The shadow direction in degree. 0 means right, 90 menas staright downwards.
shadowDepth decimal 4.7 How far the shadow will be from the image.

size and rotation attributes

attribute type sample value description
rotation decimal 40.7 Defaults to 0 degree. It rotates the whole image. Shadow for the whole image won't change it's direction with the rotation. The content shadow does.
width decimal 200.7 If you give this number, then the rendered image will have this width. If the content is larger then it will be cropped, if smaller then it will have an extra space. The border will resize with the whole image.
height decimal 80.7 If you give this number, then the rendered image will have this height. If the content is larger then it will be cropped, if smaller then it will have an extra space. The border will resize with the whole image.
maxWidth decimal
maxHeight decimal

Last edited Feb 27, 2011 at 7:40 PM by Tocsi, version 9

Comments

No comments yet.