# CNS Image Import, edit, and export images in the FileMaker environment.
## Features Import Images with dynamic paths and filenames Export Images with dynamic paths and filenames Get a variety of information about an image Convert image type, size, resolution, depth, quality, and target size Crop an image Rotate an image Reflect or flip an image Apply a Quicktime filter to an image Transform an image (squish or stretch) Download an image from the internet directly into a container field Extract layers of an image as new images (Including Photoshop and PDFs) | ## Possible Uses Download GUI elements to your solution. Create any sized thumbnails for images. Download webcams and other dynamic images to your solutions. Create an image browser. Create a catalog solution. Turn a PDF into separate images for cross-platform viewing in FileMaker. Create a screenshot gallery of your solution complete with thumbnails. Example database includes six mini solutions as starting points. Remember, this is just a short list of ideas, the possibilities are countless.

# Documentation Overview

##
The following is a description of each section of the CNS Image documentation.

### Overview of Chapters

#### The following is an overview of the chapters in the CNS Image documentation.

Chapter 1: Introduction
An overview of what the CNS Image plug-in is capable of doing, and how it can help you with your image needs.
Chapter 2: Installation, Configuration, and Registration
How to install, configure, and register CNS Image.
Chapter 3: CNS Image.fp7 Example Database
This chapter lists each example and a description of each example for the CNS Image.fp7 database.
Chapter 4: Credits & Contact Information
Credit and contact information for CNS Image.

### Overview of Appendixes

#### The following is an overview of the appendixes in the CNS Image documentation.

CNSImage_Convert
CNSImage_Copy
CNSImage_Crop
CNSImage_Export
CNSImage_File_GetPathToDB
CNSImage_File_GetPathToFM
CNSImage_File_SelectFileWithDialog
CNSImage_File_SelectFolderWithDialog
CNSImage_Filter
CNSImage_GetFromURL
CNSImage_GetInfo
CNSImage_Import
CNSImage_Reflect
CNSImage_Register
CNSImage_Rotate
CNSImage_Transform
CNSImage_Version
Reference: Image Types
Reference: Paths
Appendix A: Functions

The following is a list of all available functions and a complete description of each. For general information on how the External functions work and how you can use them in your calculations, please see the How to use Plug-ins PDF Document available on the CNS Plug-ins website.

### Overview of Figures

#### The following is an overview of the figures in the CNS Image documentation.

#### Chapter 2:

Installing
Basics Tab
About Tab

#### Chapter 3:

Importing
Exporting
Information
Convert
Crop
Rotate
Reflect
Filter
URL
Transform
Screenshot Crop (Mini Solution)
Webcams (Mini Solution)
Earth View (Mini Solution)
Map Viewer (Mini Solution)
Simple Image Browser (Mini Solution)
PDF Page Splitter
Custom Functions

# Chapter 1

## Introduction
An overview of what the CNS Image plug-in is capable of doing, and how it can help you with your image needs.

### What is CNS Image?

CNS Image can import images into container fields and export images from container fields. What the plug-in can do with images while in FileMaker is where it gets interesting.

Imagine importing a folder of digital photos into FileMaker. There are several tasks you will probably want to apply to your photos. You may want to rotate a photo from landscape to portrait. You may want to crop a photo down to capture the subject of the photo better. You may want to flip or reflect a photo horizontally, vertically, or both. You may want to apply a sepia color tint to the photo to give it that antique look. You may want to sharpen the photo up and adjust the hue or saturation of the photo to make the colors pop out better. You may want to extract a layer from a Photoshop or PDF document. All of these things, and more, can be done using CNS Image, and you do not even have to leave FileMaker to accomplish them.

You can also use CNS Image to download an image from the internet right into a container field. Such a feature can be used to download webcam images, dynamic images of the earth, road maps, and even images to update the look of your solution. Imagine creating a new backdrop, header, or logo that is automatically downloaded when your users open a solution you have created.

CNS Image also gives you the ability to apply a QuickTime filter to an image. QuickTime comes with several built in filters such as Brightness, ColorSync, HSL Balance, RGB Balance, Blur, Edge Detection, Emboss, Sharpen, Color Style, Color Tint, and more. There are also third party filters available on the internet.

What once was impossible, is now a reality, with CNS Image and FileMaker 7.

### A visual guide...

This section consists of several images that serve as visual examples of how the plug-in can be used. The first image on the left of each example is the original image used. Remember, all of these images were created without even leaving FileMaker, and the example database was used to create them.

#### Convert

The Convert function allows you to change the format of an image including the width and height as the images below demonstrate.

#### Crop

Below are three examples of using CNS Image to crop.

#### Filters

You can use CNS Image to apply a filter to an image. The following filters have been applied to the CNS Logo below: Blur, Brighten, Hue, Lightness, RGB (Full Blue), RGB (Full Green), RGB (Full Red), Saturation, Colbalt, Lens Flare, Sepia, Sharpen, Soloarize, Tint (with custom settings), and Xray. Keep in mind that these are just a few examples.

#### Reflect

Below are examples of the Reflect fucntion for horizontal, virtical, and both.

#### Rotate

Below are a few examples of rotating an image.

#### Transform

Below are several examples of using the Transform function on an image. As you can see, you can get some very interesting results.

#### URL

Below are a few examples of images downloaded via a URL. Pictured is the Alamo cam, the SOHO TRACE cam, and the Jesse cam (Jesse and son Samuel) at http://jesse.cnsplug-ins.com

# Chapter 2

## Installation, Configuration, and Registration
How to install, configure, and register CNS Image.

### Installation

Installing CNS Image is very easy. If FileMaker Pro is open, then close it. Next, locate the folder on your hard drive that contains your FileMaker Pro application. For Macintosh, this is usually in the Applications folder; while on Windows, it is usually in the Program Files folder. Next to the FileMaker Pro application, you should see a folder named Extensions. Copy the plug-in file into this folder to install it into FileMaker Pro.

Figure 2.1 Installation

After installing the plug-in as described above, you can open FileMaker Pro again and set the defualt preferences if you wish. To do this on Windows, go to the "Edit" menu, and then select "Preferences". This should bring up the "Preferences" dialog. Next, click on the "Plug-ins" tab, and then double-click the CNS Image plug-in. On Mac OSX, go to the "FileMaker Pro" menu, and then select "Preferences". This should bring up the "Preferences" dialog. Next, click on the "Plug-ins" tab, and then double-click the CNS Menu plug-in.

### Configuration

#### Basics

Once the Configuration Dialog is open, click the Basics tab where you can set the following value. The Add Help Comments to External Functions check box allows you to enable or disable the help comments that are displayed in a calculation window when inserting a function into your calculation.

Figure 2.2 Basics Tab

#### About

The About Tab reports which version of CNS Image you are using, who the plug-in is registered to, and how many seats the plug-in is registered for. You can also use the Version function to bring up the Configuration Dialog by passing the function the string "CONFIGURE" or the string "ABOUT". To make sure that you have the most recent version of CNS Image, please visit our website (http://cnsimage.cnsplug-ins.com/)

Figure 2.5 About Tab

### Registration

When you decide to purchase CNS Image, you can obtain a license from our secure online purchase form at https://secure.comm-unity.net/products.htm?product=CNS%20Image. Once you have purchased a license to use CNS Image, we will email you a registration code to register your copy of the plug-in. To do that, open any of the example databases, press the "Register CNS Image" button, and enter your registration information.

# Chapter 3

## CNS Image.fp7 Example Database
This chapter lists each example and a description of each example for the CNS Image.fp7 database.

### Introduction

The example database demonstrates how to use CNS Image to manipulate images directly in FileMaker. It will show you how to import and export images. It will show you how to gather information about an image. Additionally, it will demonstrate how to convert, scale, crop, rotate, reflect, transform, get a layer, and apply a QuickTime filter to an image. You can also download an image from the internet directly into a container field.

The example database goes one step further by giving you six mini solutions that are great starting points for your own solutions. You can also easily integrate these ideas into your current solutions. The mini solutions include: Screehshot Crop, Webcams, Earth View, Map Viewer, Simple Image Browser, and PDF Page Splitter.

All examples have documentation on the same layout as the example for quick reference. Examples are listed in the "Example Index" area and are sorted by the "Example Rating" which can be found at the bottom of each example.

You may want to note the "If you want to..." link in the top right corner of each layout. This link leads to a layout which has a task oriented list of things you may want to do, and links to quickly get to the information you need to know. For example, if you want to "Crop an image" then view the example "Crop" or view the function "CNSImage_Crop". There are buttons that take you to the example or the function depending on what you want to do.

### Importing

Figure 3.2 Screenshot of the "Importing" example.

There are several ways to get images into FileMaker. You can use the native capabilities to import images using only FileMaker. You can also use functionality in CNS Image to import images in ways that FileMaker cannot.

For example, you can create a dialog box that opens to a specified folder to import images from. You can even specify what type of images a user can import. You can also import an image to a container field by using a variety of different path types, including FileMaker 7 image paths.

### Exporting

Figure 3.3 Screenshot of the "Exporting" example.

The ability to export an image from a container field is somewhat limited when left to just FileMaker. However, several options are opened when using CNS Image. You can save an image to any folder with any name. So you can do interesting things like export each image in a found set to your desktop using the record ID as the file name.

### Information

Figure 3.4 Screenshot of the "Information" example.

This example demonstrates how you can use CNS Image to get information about an image such as its type, width, height, horizontal resolution, vertical resolution, depth, quality, size, path, and file name.

### Convert

Figure 3.5 Screenshot of the "Convert" example.

Using the CNSImage_Convert function, you can change the format of a image, the width and height, the resolution, the depth, the quality, and the target size. This example demonstrations how to accomplish these conversions.

### Crop

Figure 3.6 Screenshot of the "Crop" example.

This example demonstrates how to crop an image down, that is, to create a new image from part of a bigger image.

### Rotate

Figure 3.7 Screenshot of the "Rotate" example.

This example demonstrates how to use CNS Image to rotate an image.

### Reflect

Figure 3.8 Screenshot of the "Reflect" example.

This example shows you how to flip an image horizontally, vertically, or both.

### Filter

Figure 3.9 Screenshot of the "Filter" example.

This is where CNS Image can get a bit interesting because you can, for the first time that we know of, manipulate an image while still being in the FileMaker Pro environment. Never before could you change the hue of an image, or brighten or darken an image.

For example, say you have a picture that looks nice, but you want the colors to pop out more. Simply take a trip through the filter function and max out the saturation. Maybe you have a picture of a family member and you want to give it that old "Sepia" look. Not a problem. Just apply the "Color Tint" quicktime filter using the "Sepia" preset.

You can even use the filter function to tweak your graphical user interface images right in your database.

### URL

Figure 3.10 Screenshot of the "URL" example.

This example demonstrates the ability to download an image from the internet and put it directly into a container field. You simply give the plug-in a url and it will download the image and put it in the field you want it to. No importing is necessary. No temporary file is needed. No special tricks. Just a URL and the plug-ins takes care of the rest.

For some interesting uses of this function, take a look at the "Mini Solutions" that we have created for the example database including: "Webcams", "Earth View", and "Map Viewer".

### Transform

Figure 3.11 Screenshot of the "Transform" example.

The transform function allows you to pick 4 points of your image to adjust how the image is drawn. With it you can skew an image, stretch an image, or even squish an image.

### Screenshot Crop (Mini Solution)

Figure 3.12 Screenshot of the "Screenshot Crop" mini solution.

This example takes a snapshot of a given layout and then crops the image to the correct size based on the actual size of window content. It also demonstrates just cropping out a portion of a layout based on field bounds.

The basic trick is to enter preview mode, copy, and then paste the resulting image into a container field. You can then use CNS Image to crop it to the needed size.

### Webcams (Mini Solution)

Figure 3.13 Screenshot of the "Webcams" mini solution.

This "Mini Solution" is a simple webcam viewer. You can choose a category from the pull down menu on the top left, and then click a link in the portal to view the web cam picture.

This example includes several interesting ideas such as downloading an image that changes at set intervals such as every minute or every day. While the image is downloaded, we actually set the container field to a text string to show the download progress. After the image is downloaded, you have the option to automatically rotate and flip it based on field values. We also create a 25 pixel thumbnail icon after the image is downloaded just for good measure.

We have included a decent range of images to download from daily cartoons, famous places, photos of the sun that were taken within the last hour by NASA, and even the current weather for the entire USA. These are all images that are available free on the internet, so keep in mind that any of the images may change, may be temporarily down, or may no longer be offered by their respective servers.

### Earth View (Mini Solution)

Figure 3.14 Screenshot of the "Earth View" mini solution.

This "Mini Solution" uses the "Earth and Moon Viewer" website located at http://www.fourmilab.ch/earthview/vplanet.html to grab generated images that show day and night regions of the Earth at this moment. There are many different variables that you can tinker with to get a wide variety of images.

You can also use different image types for the Earth as well as the Moon. In addition, you can change the view point and the date and time for an image.

### Map Viewer (Mini Solution)

Figure 3.15 Screenshot of the "Map Viewer" mini solution.

This example retrieves a dynamically created map from the TIGER Map Server of the U. S. Census Bureau. For an overview of the system, take a look at http://www.census.gov/geo/www/tiger/tigermap.html. To view a map on the site, visit http://tiger.census.gov/cgi-bin/mapbrowse-tbl.

The Map Viewer example allows you to select a location via a "Quick Lookup" portal. You can then change the attributes of the map for roads, bounds, and labels that are shown. We have also built zooming and panning (moving) into the solution.

Keep in mind that the system is based on information from 1990 and 1998, so it is somewhat old. It does, however, help demonstrate that you can build a map browser inside of FileMaker with very little work and the use of the CNSImage_GetFromURL function.

The TIGER maps are public domain, so this service is free. However, because the data is old it may only be partially useful. The TIGER website also makes it quite clear that the service is not meant to be a full fledged map server the likes of MapQuest or Maporama, or Google Maps.

Both Mapquest.com and Maporama.com offer commercial solutions that can be integrated into FileMaker in a fashion similar to, if not exactly like, this example.

### Simple Image Browser (Mini Solution)

Figure 3.16 Screenshot of the "Simple Image Browser" mini solution.

This "Mini Solution" demonstrates a simple image browser. Using FileMaker, you can import a folder of images. You can then navigate through them with the forward and backward buttons. You can click an image to view detail for the image. You can then edit the image by using the buttons to rotate, apply filter, flip, and crop. If you are using the OS X version of FileMaker, you can use the "Set Mac Desktop" button to set the desktop picture to the currently selected image. Lastly, you can export your edited image.

### PDF Page Splitter (Mini Solution)

Figure 3.17 Screenshot of the "PDF Page Splitter" example.

This example takes a PDF and splits it into jpegs. It includes a script that will iterate through each page of the PDF and save them in a portal. The end result is one JPEG image record for each page of the original PDF. The script uses the CNSImage_GetLayer function and renders each page at 72dpi. You can also render pages at 300dpi if needed.

### Custom Functions

Figure 3.18 Screenshot of the "Custom Functions" example.

This example simply lists a few custom functions that are used in this database as well as a few that may come in handy that are not actually used in this example database. If you are using FileMaker Developer, you can view and edit Custom Functions. If you are just using FileMaker Pro, you can use Custom Functions, but you cannot edit them.

FileMaker introduced Custom Functions with FileMaker Developer 7. Custom functions allow a developer to create their own functions using any functions available to them in the calculation engine. This includes normal FileMaker functions, but also includes any Plug-in functions that are installed as well.

# Chapter 4

## Credits & Contact Information
Credit and contact information for CNS Image.

### Credits

Programming
  John Kornhaus
  Jake Traynham
Documentation
  Jesse Traynham
  Daniel Sims
Example Database
  Jesse Traynham
Product Testing, Example Database Testing
  Jesse Traynham
  Daniel Sims

### Contact Information

Email: cnsimage@cnsplug-ins.com
CNS Image Website: http://cnsimage.cnsplug-ins.com
Main Website: http://www.cnsplug-ins.com/
Phone: 817-560-4226
Fax: 817-244-0340

You can write us at:
Comm-Unity Networking Systems
8652 Camp Bowie West
Fort Worth, Texas 76116

No error: 0
1

# Appendix A: Functions

The following is a list of all available functions and a complete description of each. For general information on how the External functions work and how you can use them in your calculations, please see the How to use Plug-ins PDF Document available on the CNS Plug-ins website.

## CNSImage_Convert

Title
  CNSImage_Convert
Format
  CNSImage_Convert( Image ; Type {; Width {; Height {; Resolution {; Depth {; Quality {; TargetSize }}}}}} )
Data Type Returned
  Image
Description
  The CNSImage_Convert function allows you to convert an image. You can change the type of the image as well as the width, height, resolution, and depth. If your target image type is JPEG or TIFF, you can set the Quality. If your target image type is JPEG, you can set the targetsize.
  For a list of image types, see "Reference: Image Types".
Parameters (Required)
  - Image - A Container field that contains an Image or a Path and File Name to an Image you want to Convert.
  - Type - The Type of the new Image. (Specify "" to keep the current Image Type. Types include: JPEG, GIF, PNG, BMP, EPS, PICT, TIFF, PSD, FPIX, QTIF, SGI, TPIC, MACPAINT, and PDF.)
Parameters (Optional)
  - Width - The Width in pixels of the new Image. (Specify "" to keep the current Width.)
  - Height - The Height in pixels of the new Image. (Specify "" to keep the current Height.)
  - Resolution - The Resolution in pixels per inch of the new Image. (Specify "" to keep the current Resolution.)
  - Depth - The Bit-Depth of the new Image. (All settings may not work for all Image Types; Specify "" to keep the current Bit-Depth. Depths include: 1, 2, 4, 8, 16, 24, 32, -, 33, 34, 36, and 40.)
  - Quality - The Quality of the new Image. (Only available for JPEGs and TIFFs; Specify "" to keep the current Quality. You can also specify a number or keyword: min = 0, low = 256, normal = 512, high = 768, max = 1023, lossless = 1024.)
  - TargetSize - The Target File Size of the new Image. (Only available for JPEGs.)
Example
  CNSImage_Convert( MyImage ; "JPEG" ; 100 ; 100 ; 72 ; 32 ; 1024 )
  -> Returns a JPEG image 100 pixels wide with a resolution of 72, a depth of 32, and quality of 1024.
  CNSImage_Convert( MyImage ; "PNGf" ; 100 ; 100 ; 72 )
  -> Returns a PNG image 100 pixels wide with a resolution of 72.
Related
  Reference: Image Types

## CNSImage_Copy

Title
  CNSImage_Copy
Format
  CNSImage_Copy( Image )
Data Type Returned
  Image
Description
  This function is used in conjunction with the CNSImage_Import function to make a copy of the original image in case you need to populate the container field if the user cancels. Its use is limited to working around a bug in 7.0v3 and before when copying a container into itself.
Parameters (Required)
  - Image - A Container field that contains an Image or a Path and File Name to an Image you want to Copy
Example
  CNSImage_Copy( Importing::original )
  -> Returns a copy of the image in the "Importing::original" container field

## CNSImage_Crop

Title
  CNSImage_Crop
Format
  CNSImage_Crop( Image ; Top ; Left ; Bottom ; Right )
Data Type Returned
  Image
Description
  The CNSImage_Crop function allows you to create a new image based on part of an image. In other words, it takes an image, crops it to your specifications and then returns it to you.
Parameters (Required)
  - Image - A Container field that contains an Image or a Path and File Name to an Image you want to Crop.
  - Top ; Left - The pixel coordinates of the Top, Left corner of the Crop rectangle.
  - Bottom ; Right - The pixel coordinates of the Bottom, Right corner of the Crop rectangle.
Example
  CNSImage_Crop( MyImage ; 0 ; 0 ; 100 ; 100 )
  -> Returns a 100 square pixel area from the image in the "MyImage" container.

## CNSImage_Export

Title
  CNSImage_Export
Format
  CNSImage_Export( Image {; Path {; Prompt {; AllowConvert {; TypeList }}}} )
Data Type Returned
  String
Description
  This function allows you to save an image to any folder with any name. You can also export an image using a dialog. The function will return a string indicating the success or failure of the operation.
Parameters (Required)
  - Image - A Container field that contains an Image or a Path and File Name to an Image you want to Export.
Parameters (Optional)
  - Path - The Path and File Name the Image will be Exported to. (Specify "" or omit File Name to display Save File Dialog).
  - Prompt - A message to be displayed in the Save File Dialog.
  - AllowConvert - If True, this allows you to select an alternate File Type to Convert to as you Export. (Only available if the Save File Dialog is displayed.)
  - TypeList - A comma or semicolon-delimited list of Image File Types the user is Allowed to Convert to. (Valid Types are: JPEG, GIF, PNG, BMP, PICT, TIFF, PSD, FPIX, QTIF, SGI, TPIC, MACPAINT, PDF)
Example
  CNSImage_Export( Image )
  -> Displays a save file dialog. You can edit the name of the file and navigate in the file dialog prior to saving.
  CNSImage_Export( Image ; "/Drive/folder/filename.jpg" )
  -> Saves an image to the folder "/Drive/folder/" with the name "filename.jpg".
  CNSImage_Export( Image ; "Drive/folder/" )
  -> Displays a save file dialog starting in the folder "Drive/folder/". You can edit the name of the file in the file dialog prior to saving.
  CNSImage_Export( Image ; "" ; "Please locate where you would like to save this image." )
  -> Displays a save file dialog with the prompt: "Please locate where you would like to save this image." . You can edit the name of the file in the file dialog prior to saving.
  CNSImage_Export( Image ; "Drive/folder/" ; "" ; True )
  -> Displays a save file dialog starting in the folder "Drive/folder/". You can edit the name of the file in the file dialog prior to saving and specify a different image format for the file to convert the image if you want.

## CNSImage_File_GetPathToDB

Title
  CNSImage_File_GetPathToDB
Format
  CNSImage_File_GetPathToDB
Data Type Returned
  String
Description
  This function will return the Hard Drive Path to the Folder containting the Front-most Database in FileMaker. This is similar to FileMaker's own Get(FilePath) function, but returns the Path in a nicer format, plus it doesn't include the Database File Name. If the front-most database is a hosted database, this function will return an error.
Example
  CNSImage_File_GetPathToDB
  -> Returns a path to the folder containing the front-most database in FileMaker.

## CNSImage_File_GetPathToFM

Title
  CNSImage_File_GetPathToFM
Format
  CNSImage_File_GetPathToFM
Data Type Returned
  String
Description
  This function will return the Hard Drive Path to the Folder containing the currently running FileMaker Application, be it FileMaker Pro, FileMaker Server, Web Publishing Engine, or a FileMaker Runtime.
Example
  CNSImage_File_GetPathToFM
  -> Returns the path to the folder containting the running FileMaker application.

## CNSImage_File_SelectFileWithDialog

Title
  CNSImage_File_SelectFileWithDialog
Format
  CNSImage_File_SelectFileWithDialog{( StartPath {; TypeList {; Prompt }} )}
Data Type Returned
  String
Description
  The CNSImage_File_SelectFileWithDialog function allows you to use a dialog to locate a file on your hard drive and returns the path of the chosen file. You can specify the starting folder by specifying the optional "StartPath" param. You can limit the type of files to choose from by using the optional "TypeList" param. You can also display a message in the dialog by using the optional "Prompt" param.
Parameters (Optional)
  - StartPath - The Path to the Folder to display when the dialog first opens.
  - TypeList - A comma or semicolon-delimited list of Image File Types the user is allowed to Choose. For a complete list of types, view the "Reference: Image Types" section of the Function Reference.
  - Prompt - An optional Prompt or Message to display on the dialog.
Example
  CNSImage_File_SelectFileWithDialog
  -> A dialog is shown to choose a file.
  CNSImage_File_SelectFileWithDialog( "~/Desktop/" )
  -> A dialog is shown with the current user's Desktop as the starting folder.
  CNSImage_File_SelectFileWithDialog( "" ; "JPG, PNG" )
  -> A dialog is shown to choose a file limited to JPG and PNG image types.
  CNSImage_File_SelectFileWithDialog( "" ; "JPG" ; "Please choose a JPG image:" )
  -> A dialog is shown to choose a file limited to JPG images with the prompt: "Please choose a JPG image:".
  CNSImage_File_SelectFileWithDialog( "" ; "" ; "Choose any image...." )
  -> A dialog is shown to choose any type of image with the prompt: "Choose any image...".
Related
  CNSImage_File_SelectFolderWithDialog

## CNSImage_File_SelectFolderWithDialog

Title
  CNSImage_File_SelectFolderWithDialog
Format
  CNSImage_File_SelectFolderWithDialog{( StartPath {; Prompt } )}
Data Type Returned
  String
Description
  You can use this function to choose a folder using a dialog box. You can use the optional "StartPath" param to specify which folder to display when the dialog first opens. You can use the optional "Prompt" param to display a message in the dialog box.
Parameters (Optional)
  - StartPath - The Path to the Folder to display when the dialog first opens.
  - Prompt - An optional Prompt or Message to display on the Dialog.
Example
  CNSImage_File_SelectFolderWithDialog
  -> Displays a dialog so you can choose folder. The chosen path is returned.
  CNSImage_File_SelectFolderWithDialog( "/" )
  -> Displays a dialog so you can choose a folder, starting with the startup volume or first drive.
  CNSImage_File_SelectFolderWithDialog( "Please choose a folder:" )
  -> Displays a dialog so you can choose folder with the prompt: "Please choose a folder". The chosen path is returned.
Related
  CNSImage_File_SelectFileWithDialog

## CNSImage_Filter

Title
  CNSImage_Filter
Format
  CNSImage_Filter( Image )
Data Type Returned
  Image
Description
  With this function, you can apply a QuickTime filter to an image. QuickTime comes with several built-in filters such as Brightness, ColorSync, HSL Balance, RGB Balance, Blur, Edge Detection, Emboss, Sharpen, Color Style, Color Tint, and more. There are also third party filters available on the net.
Parameters (Required)
  - Image - The Container that contains the Image you want to Filter.
Example
  CNSImage_Filter( MyImage )
  -> Opens the filter dialog, and returns the filtered image after you have made your selection.

## CNSImage_GetFromURL

Title
  CNSImage_GetFromURL
Format
  CNSImage_GetFromURL( URL )
Data Type Returned
  Image
Description
  You can download an image on the internet with this function. You can download fun images such as webcams, daily cartoons, or photos of the sun. You can also post new graphics for your solution to be downloaded across the net. Imagine if your database could check for new interface files on the net as part of your startup routine. Stop imagining, this is reality!
Parameters (Required)
  - URL - The full URL of the Image to Get.
Example
  CNSImage_GetFromURL( "http://www.cnsplug-ins.com/graphics/CNS_mini_logo.jpg" )
  -> Returns the "CNS_mini_logo.jpg" JPEG at the address "http://www.cnsplug-ins.com/graphics/CNS_mini_logo.jpg"

## CNSImage_GetInfo

Title
  CNSImage_GetInfo
Format
  CNSImage_GetInfo( Image {; Field } )
Data Type Returned
  String
Description
  The CNSImage_GetInfo function returns information about an image such as the format, width, height, resolution, depth, quality, and size. You can also using the "Item" parameter to retrieve a specific value such as the width of an image.
Parameters (Required)
  - Image - The Container that contains the Image you need the Info of.
Parameters (Optional)
  - Field - A specific Info Item you need. (If this parameter is not defined, all Info Items will be returned. You can specify multiple fields separated by a semicolon. Fields: type, width, height, hres, vres, depth, quality, filesize, displaywidth, displayheight, layers, pathname, filename, and storage. )
Example
  CNSImage_GetInfo( MyImage )
  -> Returns a return delimited string of information for the image in the "MyImage" container.
  CNSImage_GetInfo( MyImage ; "width" )
  -> Returns the width of the image in the "MyImage" container.
  CNSImage_GetInfo( MyImage ; "height;width" )
  -> Returns the height and width separated by a return.

## CNSImage_Import

Title
  CNSImage_Import
Format
  CNSImage_Import{( Path {; TypeList {; Prompt }} )}
Data Type Returned
  Image
Description
  The CNSImage_Import function allows you to easily import images into FileMaker. You can import by specifying a path to an image as well as using a dialog box to navigate to a desired image.
Parameters (Optional)
  - Path - The Path and File Name of the Image to Import. (Specify "" or omit File Name to display Open File Dialog).
  - TypeList - A comma or semicolon-delimited list of Image File Types the user is allowed to Import. Types include: JPEG, GIF, PNG, BMP, EPS, PICT, TIFF, PSD, FPIX, QTIF, SGI, TPIC, MACPAINT, and PDF.
  - Prompt - A message to be displayed in the Open File Dialog.
Example
  CNSImage_Import
  -> A dialog is shown to choose an image.
  CNSImage_Import( "/drive/folder/")
  -> A dialog is shown to choose a file starting at the folder "/drive/folder/"
  CNSImage_Import( "" ; "JPG, PNG" )
  -> A dialog is shown to choose a file limited to JPG and PNG image types.
  CNSImage_Import( "" ; "JPG" ; "Please choose a JPG image:" )
  -> A dialog is shown to choose a file limited to JPG images with the prompt: "Please choose a JPG image:".
  CNSImage_Import( "" ; "" ; "Choose any image...." )
  -> A dialog is shown to choose any type of image with the prompt: "Choose any image...".

## CNSImage_Reflect

Title
  CNSImage_Reflect
Format
  CNSImage_Reflect( Image; Direction )
Data Type Returned
  Image
Parameters (Required)
  - Image - The Container that contains the Image you want to Reflect.
  - Direction - The Direction to Reflect the Image. (Specify X or H for Horizontal, Y or V for Vertical, or B or L for Both Horizontal and Vertical.)
Example
  CNSImage_Reflect( Image; "H" )
  -> Reflects the image in the "Image" container field horizontally.

## CNSImage_Register

Title
  CNSImage_Register
Format
  CNSImage_Register( FirstName ; LastName ; RegNumber {; Option } )
Data Type Returned
  String
Description
  You can use this function to register a plug-in without having to use a dialog box. If you use the "Option" parameter, you can register via a dialog box using the "Dialog" value. You can also use value "Check" to test to see if the plug-in is registered or not. Finally, you can use the value "I Accept the License Agreement" to automatically accept the License Agreement dialog.
Parameters (Required)
  - First_Name - The Registration First Name you specified when you ordered. (See your Receipt.)
  - Last_Name - The Registration Last Name you specified when you ordered. (See your Receipt.)
  - Reg_Number - The Registration Number from your Receipt.
Parameters (Optional)
  - Option - Specify "Dialog" to enter your Registration Information in a Pop Up Dialog. (You can also specify "Dialog" as the FirstName parameter.) Specify "Check" to see if the plug-in is already Registered. (You can also specify "Check" as the FirstName parameter.) Specify "I Accept the License Agreement" to automatically accept the License Agreement dialog.

## CNSImage_Rotate

Title
  CNSImage_Rotate
Format
  CNSImage_Rotate( Image ; Degrees )
Data Type Returned
  Image
Parameters (Required)
  - Image - A Container field that contains an Image or a Path and File Name to an Image you want to Rotate.
  - Degrees - The Amount in Degrees that you want to Rotate the Image.
Example
  CNSImage_Rotate( Image ; 45 )
  -> Rotates the image in the "Image" field 45 degrees.

## CNSImage_Transform

Title
  CNSImage_Transform
Format
  CNSImage_Transform( Image ; X1 ; Y1 ; X2 ; Y2 ; X3 ; Y3 ; X4 ; Y4 )
Data Type Returned
  Image
Parameters (Required)
  - Image - A Container field that contains an Image or a Path and File Name to an Image you want to Transform.
  - X1 ; Y1 - The pixel coordinates of the Top, Left corner of the Transformation Rectangle.
  - X2 ; Y2 - The pixel coordinates of the Top, Right corner of the Transformation Rectangle.
  - X3 ; Y3 - The pixel coordinates of the Bottom, Right corner of the Transformation Rectangle.
  - X4 ; Y4 - The pixel coordinates of the Bottom, Left corner of the Transformation Rectangle.
Example
  CNSImage_Transform( Image ; 0 ; 0 ; 200 ; 0 ; 200 ; 500 ; 0 ; 500 )
  -> Transforms the image in the "Image" field. (Depending on the image, this would likely squish the image horizontally. For an example of this function in action, view the "Transform" example.)

## CNSImage_Version

Title
  CNSImage_Version
Format
  CNSImage_Version{( Option )}
Data Type Returned
  String
Parameters (Optional)
  - Option - You can use the following options: Specify "Auto Update" to return a more Auto Update friendly Version number, Specify "Configure" to bring up the "CNS Image" Configuration Dialog, Specify "About" to bring up the "CNS Image" Configuration Dialog with the About Tab as the first tab shown.
Example
  CNSImage_Version
  -> Returns the version number.
  CNSImage_Version( "About" )
  -> Brings up the "CNS Image" Configuration Dialog with the About Tab as the first tab shown.
  CNSImage_Version( "Configure" )
  -> Brings up the "CNS Image" Configuration Dialog
  CNSImage_Version( "Auto Update" )
  -> Specify "Auto Update" to return a more Auto Update friendly Version number

## Reference: Image Types

Title
  Reference: Image Types
Description
  CNS Image uses the QuickTime libraries to import, export, and convert your images. QuickTime does not support all image formats for all operations. Below is a break down of what can be imported, exported, and converted.
  Image Formats that can be Imported, or Converted From, on Both Mac OS X and Windows:

  Image Name | File Type | File Extensions
  --- | --- | ---
  JPEG | JPEG | .jpg; .jpeg; .jfif; .jpe
  GIF | GIFf | .gif
  PNG | PNGf | .png
  Windows Bitmap | BMPf | .bmp
  Macintosh PICT | PICT | .pct; .pict; .pic
  TIFF | TIFF | .tif; .tiff
  Photoshop | 8BPS | .psd
  QuickTime Image | qtif | .qif; .qti; .qtif; .qt
  Silicon Graphics | .SGI | .sgi
  Targa | TPIC | .tga; .tpic
  MacPaint | PNTG | .mac

  Image Formats that can be Imported, or Converted From, only on Mac OS X:

  Image Name | File Type | File Extensions
  --- | --- | ---
  PDF | PDF | .pdf

  Image Formats that can be Exported, or Converted To, on Both Mac OS X and Windows:

  Image Name | File Type | File Extensions
  --- | --- | ---
  JPEG | JPEG | .jpg; .jpeg; .jfif; .jpe
  PNG | PNGf | .png
  Windows Bitmap | BMPf | .bmp
  TIFF | TIFF | .tif; .tiff
  Photoshop | 8BPS | .psd
  QuickTime Image | qtif | .qif; .qti; .qtif; .qt
  Silicon Graphics | .SGI | .sgi
  Targa | TPIC | .tga
  MacPaint | PNTG | .mac

  Notes:
  - You can use either the Image Name or the File Type when specifying types in CNS Image.
  - On Mac OS X, CNS Image uses both the File Type and the File Extensions in the Import Dialog to determine if a file is a valid image type. On Windows, CNS Image only uses the File Extensions in the Import Dialog. When exporting images from your database, CNS Image will append the first listed file extension to the file name.
  - When using the CNSImage_Convert function, GIF images will be auto-converted to PNG images unless you specify another supported image type. PDF images will be auto-converted to JPEG images. When using the CNSImage_GetFromURL function, GIF images will automatically be converted to PNG images.
  - QuickTime does not have support for Importing or Exporting EPS images, so CNS Image will be unable to work with any "by reference" EPS images. This also means that CNSImage_Import will not be able to import EPS images. However, if FileMaker is used to Import (and store) an EPS image, CNS Image can manipulate the "JPEG Preview" stored in the container.
  - On Windows, if you paste an image into a container, the underlying format is a Windows MetaFile, DIB, or OLE format, which is incompatible with QuickTime. CNS Image will be able to manipulate the "JPEG Preview" though.

## Reference: Paths

Title
  Reference: Paths
Description
  You can use the following path types in order to reference images in CNS Image functions:
  imagemac:/HDName/folder/file.ext
  imagewin:/C:/folder/file.ext
  image:/POSIXpath/
  /Volumes/VolumeName/Folder/file.ext
  c:\folder\file.ext
  VolumeName:Folder:file.ext
  /C/Folder/file.ext
  ~/Desktop/file.ext