/**********************************************************************************************
*	LMImage ReadMe.txt file
*	LMImage Control Library V1.1
*	Copyright (c)T.L. McCaughn 2014- All Rights Reserved
*
***********************************************************************************************
License:
Copyright (c) 2014- T. L. McCaughn.  All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to 
compile into their commercial, personal and educational applications.

Redistribution of the Software is limited to your own development team and/or 
immediate family and it cannot be made publicly available or distributable as 
a stand alone product or part of any library collection or similiar product, 
even if that offering is free, without the expressed written permission of the 
author.

Ionic Wind Software is hereby granted a royality free license to distribute 
the Software for free via its forum or by packaging it with other software, 
even if the other software is not free, provided the warranty disclaimer is 
included with any distribution. 
-------------------------------------------------------------------------------------------
Disclaimer:
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHOR OR COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE AUTHOR NEITHER PROMISES NOR IMPLIES THAT THIS SOFTWARE WILL
BE MAINTAINED, FIXED, REPAIRED, OR IMPROVED.  THE USER ASSUMES ALL RISK OF USING 
THE SOFTWARE AND ACKNOWLEDGES SUCH BY LINKING THE SOFTWARE INTO ANY APPLICATION.
==========================================================================================
FUNCTIONS:
----------------------------------------------------------------------------------------
LM_Image_Create(WINDOW|DIALOG win, string filename, INT x, INT y, INT w,int h, int style, id as UINT )
Purpose:Used to create a new image control
Where:
	win is the parent WINDOW/DIALOG
	filename is for one of the following type images:
		PNG, BMP, ICON, GIF, JPEG, Exif, PNG, TIFF, WMF, and EMF 
	x,y are the cordinates for the upper left corner of the control
	w,h are the dimensions of the control
	style is for flags(not currently used
	id identifies this instance of the image control
Remarks:
	This command follows either an OPENWINDOW command or a CREATEDIALOG command

----------------------------------------------------------------------------------------
LM_Image_Init(WINDOW|DIALOG win, id as UINT )
Purpose: Used to initialize an image control
Where:
	win is the parent WINDOW/DIALOG
	id identifies this instance of the image control
Remarks:
	Mandatory command for each image control
	if the parent is a window then this command is placed in the @IDCREATE section of the parent messagehandler
	if the parent is a dialog then this command is placed in the @IDINITDIALOG section of the parent messagehandler

----------------------------------------------------------------------------------------
LM_Image_GetSize(string filename, INT w byref , int h byref )
Purpose:Gets the dimensions of a listed image type
Where:
	filename is the complete path filename of the desired image
	w,h are the predefined variables to hold the returned dimensions

========================================================================================
This applies to all the following commands
If the parent is a WINDOW the following commands are placed after the LM_Image_Create command
If the parent is a DIALOG the following commands are placed after the LM_Image_Init command
	in the @IDINITDIALOG section of the dialogs messagehandler
========================================================================================

----------------------------------------------------------------------------------------
LM_Image_SetFont(WINDOW|DIALOG win, UINT id, INT texttype, STRING typeface, INT height, INT weight,OPT UINT flags=0)
Purpose:Sets the font of the text when the image is present and when the image is not present
Where:
	win is the parent WINDOW/DIALOG
	id identifies this instance of the image control
	texttype identifies which text font is being set:
		LMI_NOIMGTEXT for the text that is displayed when the image is missing
		LMI_IMGTEXT for the text that is displayed when the image is present
	The rest of the parameters are the same as those used with the IWBasic SETFONT command.

----------------------------------------------------------------------------------------
LM_Image_SetBGColor(WINDOW|DIALOG win, id as UINT, Image as UINT, NoImage as UINT )
Purpose:Sets the background color of the image control when the image is present and when the image is not present
Where:
	win is the parent WINDOW/DIALOG
	id identifies this instance of the image control
	Image is the background color of the control when the image is present
	NoImage is the background color of the control when the image is missing

----------------------------------------------------------------------------------------
LM_Image_SetTextColor(WINDOW|DIALOG win, id as UINT, Image as UINT, NoImage as UINT )
Purpose:Sets the color of the text when the image is present and when the image is not present
Where:
	win is the parent WINDOW/DIALOG
	id identifies this instance of the image control
	Image is the text color of the control when the image is present
	NoImage is the text color of the control when the image is missing

----------------------------------------------------------------------------------------
LM_Image_SetImageText(WINDOW|DIALOG win, id as UINT, Text as string, location as INT, opt show=1 as int )
Purpose:Sets the text to be displayed in the image control when the image is present.
Where:
	win is the parent WINDOW/DIALOG
	id identifies this instance of the image control
	Text is the text to be displayed when the image is present
	Location specifies where the text will be displayed
		1 - Top left 
		2 - Top center
		3 - Top right 
		4 - Center left
		5 - Centered in the control
		6 - Center right
		7 - Bottom left 
		8 - Bottom center
		9 - Bottom right
	Show controls whether or not the text is displayed
	Multiline text can be display with the use of embedded "\n"

----------------------------------------------------------------------------------------
LM_Image_SetNoImageText(WINDOW|DIALOG win, id as UINT, Text as string, opt show=1 as int )
Purpose:Sets the text to be displayed in the image control when the image is missing.
Where:
	win is the parent WINDOW/DIALOG
	id identifies this instance of the image control
	Text is the text to be displayed when the image is present(always in the center of the control)
	Show controls wheter or not the text is displayed
	Multiline text can be display with the use of embedded "\n"

----------------------------------------------------------------------------------------
LM_Image_SetImageBorder(WINDOW|DIALOG win, id as UINT, colr as UINT, width as INT, opt show=1 as int )
Purpose:Sets the parameters for the border of the image control when the image is present.
Where:
	win is the parent WINDOW/DIALOG
	id identifies this instance of the image control
	colr is the color of the border when the image is present
	width is the width of the border
	Show controls whether or not the border is displayed when the image is present

----------------------------------------------------------------------------------------
LM_Image_SetNoImageBorder(WINDOW|DIALOG win, id as UINT, colr as UINT, width as INT, opt show=1 as int )
Purpose: Sets the parameters for the border of the image control when the image is missing.
Where:
	win is the parent WINDOW/DIALOG
	id identifies this instance of the image control
	colr is the color of the border when the image is missing
	width is the width of the border
	Show controls whether or not the border is displayed when the image is missing

----------------------------------------------------------------------------------------
LM_Image_MaintainImageRatio(WINDOW|DIALOG win, id as UINT, opt r=1 as INT)
Purpose: Causes the aspect ratio of the original image to be maintained when displayed in the image control
Where:
	win is the parent WINDOW/DIALOG
	id identifies this instance of the image control
	r controls whether or not the image is stretched to fill the control or the ratio of the image is 		maintained.

----------------------------------------------------------------------------------------
LM_Image_SaveAsEnable(WINDOW win, id as UINT, opt enable=1 as INT)
Purpose: Enables/disables a right-click context menu which allows the User to save the displayed contents of the control in one of thee following formats:
	BMP,GIF,JPG,TIFF,PNG
Where:
	win is the parent WINDOW/DIALOG
	id identifies this instance of the image control
	enable controls whether or not the context menu is displayed.

----------------------------------------------------------------------------------------
