using System ;
using System.Collections.Generic ;
using System.Runtime.InteropServices ;
using System.Text ;


namespace DxLibDLL
{


	public static partial class DX
	{


		public delegate bool UserGraphLoadFunction4( IStream Src , out BASEIMAGE Image ) ;


		/// <summary> 登録されている各種グラフィックローダ関数から、ＢＭＰデータもしくは GraphImageデータを構築する </summary>
		/// <param name="BmpInfo"> BITMAPINFO ** </param>
		public static void CreateGraphImageOrDIBGraph( string FileName , IntPtr DataImage , LOADIMAGE_TYPE DataImageSize , int DataImageType , bool BmpFlag , bool ReverseFlag , out BaseImage Image , out IntPtr BmpInfo , out IntPtr GraphData )
		{
			lock( locker )
			{
				BASEIMAGE Image_ ;
				int result = dx_CreateGraphImageOrDIBGraph( FileName , DataImage , DataImageSize , DataImageType , BmpFlag , ReverseFlag , out Image_ , out BmpInfo , out GraphData ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				Image = new BaseImage( Image_ ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateGraphImageOrDIBGraph( string FileName , IntPtr DataImage , LOADIMAGE_TYPE DataImageSize , int DataImageType , bool BmpFlag , bool ReverseFlag , out BASEIMAGE Image , out IntPtr BmpInfo , out IntPtr GraphData ) ;


		/// <summary> 汎用読み込み処理によるグラフィックイメージ構築関数( 0:成功  -1:失敗 ) </summary>
		public static void CreateBaseImageType2( IStream Src , out BaseImage Dest )
		{
			CreateGraphImageType2( Src , out Dest ) ;
		}

		/// <summary> 汎用読み込み処理によるグラフィックイメージ構築関数( 0:成功  -1:失敗 ) </summary>
		public static void CreateGraphImageType2( IStream Src , out BaseImage Dest )
		{
			lock( locker )
			{
				STREAMDATA Src_ = new STREAMDATA( Src ) ;
				BASEIMAGE Dest_ ;
				int result = dx_CreateGraphImageType2( ref Src_ , out Dest_ ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				Dest = new BaseImage( Dest_ ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateGraphImageType2( [ In ] ref STREAMDATA Src , out BASEIMAGE Dest ) ;


		/// <summary> フルカラー形式のBITMAPINFO構造体を作成する </summary>
		/// <param name="BmpInfo"> BITMAPINFO * </param>
		public static void CreateBmpInfo( IntPtr BmpInfo , int Width , int Height , int Pitch , IntPtr SrcGrData , out IntPtr DestGrData )
		{
			lock( locker )
			{
				int result = dx_CreateBmpInfo( BmpInfo , Width , Height , Pitch , SrcGrData , out DestGrData ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateBmpInfo( IntPtr BmpInfo , int Width , int Height , int Pitch , IntPtr SrcGrData , out IntPtr DestGrData ) ;


		/// <summary> ＤＩＢグラフィックを作成する(バージョン２) </summary>
		/// <returns> HBITMAP </returns>
		public static IntPtr CreateDIBGraphVer2( string FileName , IntPtr MemImage , int MemImageSize , LOADIMAGE_TYPE ImageType , bool ReverseFlag , COLORDATA SrcColor )
		{
			lock( locker )
			{
				IntPtr result = dx_CreateDIBGraphVer2( FileName , MemImage , MemImageSize , ImageType , ReverseFlag , ref SrcColor ) ;
				if( !( result != IntPtr.Zero ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_CreateDIBGraphVer2( string FileName , IntPtr MemImage , int MemImageSize , LOADIMAGE_TYPE ImageType , bool ReverseFlag , [ In ] ref COLORDATA SrcColor ) ;


		/// <summary> ＤＩＢグラフィックを作成する </summary>
		/// <param name="RGBBmp"> HBITMAP * </param>
		/// <param name="AlphaBmp"> HBITMAP * </param>
		public static void CreateDIBGraphVer2_plus_Alpha( string FileName , IntPtr MemImage , int MemImageSize , IntPtr AlphaImage , int AlphaImageSize , LOADIMAGE_TYPE ImageType , out IntPtr RGBBmp , out IntPtr AlphaBmp , bool ReverseFlag , COLORDATA SrcColor )
		{
			lock( locker )
			{
				int result = dx_CreateDIBGraphVer2_plus_Alpha( FileName , MemImage , MemImageSize , AlphaImage , AlphaImageSize , ImageType , out RGBBmp , out AlphaBmp , ReverseFlag , ref SrcColor ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateDIBGraphVer2_plus_Alpha( string FileName , IntPtr MemImage , int MemImageSize , IntPtr AlphaImage , int AlphaImageSize , LOADIMAGE_TYPE ImageType , out IntPtr RGBBmp , out IntPtr AlphaBmp , bool ReverseFlag , [ In ] ref COLORDATA SrcColor ) ;


		/// <summary> BASEIMAGE 構造体の画像情報から指定の座標のフルカラーコードを取得する </summary>
		public static int GetGraphImageFullColorCode( BaseImage GraphImage , int x , int y )
		{
			lock( locker )
			{
				int result = dx_GetGraphImageFullColorCode( ref GraphImage.buffer , x , y ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetGraphImageFullColorCode( [ In ] ref BASEIMAGE GraphImage , int x , int y ) ;


		/// <summary> 各種グラフィックデータからグラフィックイメージデータとアルファマップ用イメージデータを構築する </summary>
		public static void CreateGraphImage_plus_Alpha( string FileName , IntPtr RgbImage , int RgbImageSize , LOADIMAGE_TYPE RgbImageType , IntPtr AlphaImage , int AlphaImageSize , LOADIMAGE_TYPE AlphaImageType , out BaseImage RgbGraphImage , out BaseImage AlphaGraphImage , bool ReverseFlag )
		{
			lock( locker )
			{
				BASEIMAGE RgbGraphImage_ ;
				BASEIMAGE AlphaGraphImage_ ;
				int result = dx_CreateGraphImage_plus_Alpha( FileName , RgbImage , RgbImageSize , RgbImageType , AlphaImage , AlphaImageSize , AlphaImageType , out RgbGraphImage_ , out AlphaGraphImage_ , ReverseFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				RgbGraphImage = new BaseImage( RgbGraphImage_ ) ;
				AlphaGraphImage = new BaseImage( AlphaGraphImage_ ) ;
			}
		}

		/// <summary> 各種グラフィックデータからグラフィックイメージデータとアルファマップ用イメージデータを構築する </summary>
		public static void CreateBaseImage_plus_Alpha( string FileName , IntPtr RgbImage , int RgbImageSize , LOADIMAGE_TYPE RgbImageType , IntPtr AlphaImage , int AlphaImageSize , LOADIMAGE_TYPE AlphaImageType , out BaseImage RgbGraphImage , out BaseImage AlphaGraphImage , bool ReverseFlag )
		{
			CreateGraphImage_plus_Alpha( FileName , RgbImage , RgbImageSize , RgbImageType , AlphaImage , AlphaImageSize , AlphaImageType , out RgbGraphImage , out AlphaGraphImage , ReverseFlag ) ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateGraphImage_plus_Alpha( string FileName , IntPtr RgbImage , int RgbImageSize , LOADIMAGE_TYPE RgbImageType , IntPtr AlphaImage , int AlphaImageSize , LOADIMAGE_TYPE AlphaImageType , out BASEIMAGE RgbGraphImage , out BASEIMAGE AlphaGraphImage , bool ReverseFlag ) ;


		/// <summary> 指定の GraphImage を左右反転する </summary>
		public static void ReverseGraphImage( BaseImage GraphImage )
		{
			lock( locker )
			{
				int result = dx_ReverseGraphImage( ref GraphImage.buffer ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ReverseGraphImage( [ In , Out ] ref BASEIMAGE GraphImage ) ;


		/// <summary> ＢＭＰ を GraphImage に変換する( Ret 0:正常終了  1:コピーを行った  -1:エラー ) </summary>
		/// <param name="BmpInfo"> BITMAPINFO * </param>
		public static void ConvBitmapToGraphImage( IntPtr BmpInfo , IntPtr GraphData , out BaseImage GraphImage , bool CopyFlag )
		{
			lock( locker )
			{
				BASEIMAGE GraphImage_ ;
				int result = dx_ConvBitmapToGraphImage( BmpInfo , GraphData , out GraphImage_ , CopyFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				GraphImage = new BaseImage( GraphImage_ ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ConvBitmapToGraphImage( IntPtr BmpInfo , IntPtr GraphData , out BASEIMAGE GraphImage , bool CopyFlag ) ;


		/// <summary> GraphImage を ＢＭＰ に変換する(アルファデータはあっても無視される)( Ret 0:正常終了  1:コピーを行った  -1:エラー ) </summary>
		public static void ConvGraphImageToBitmap( BaseImage GraphImage , out IntPtr BmpInfo , out IntPtr GraphData , bool CopyFlag )
		{
			ConvGraphImageToBitmap( GraphImage , out BmpInfo , out GraphData , CopyFlag , true ) ;
		}

		/// <summary> GraphImage を ＢＭＰ に変換する(アルファデータはあっても無視される)( Ret 0:正常終了  1:コピーを行った  -1:エラー ) </summary>
		/// <param name="BmpInfo"> BITMAPINFO * </param>
		public static void ConvGraphImageToBitmap( BaseImage GraphImage , out IntPtr BmpInfo , out IntPtr GraphData , bool CopyFlag , bool FullColorConv )
		{
			lock( locker )
			{
				BmpInfo = DxAlloc( 10 * 4 + 256 * 4 ) ;
				int result = dx_ConvGraphImageToBitmap( ref GraphImage.buffer , BmpInfo , out GraphData , CopyFlag , FullColorConv ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ConvGraphImageToBitmap( [ In ] ref BASEIMAGE GraphImage , IntPtr BmpInfo , out IntPtr GraphData , bool CopyFlag , bool FullColorConv ) ;


		/// <summary> ＤＩＢグラフィックを作成する </summary>
		/// <returns> HBITMAP </returns>
		public static IntPtr CreateDIBGraph( string FileName , bool ReverseFlag , COLORDATA SrcColor )
		{
			lock( locker )
			{
				IntPtr result = dx_CreateDIBGraph( FileName , ReverseFlag , ref SrcColor ) ;
				if( !( result != IntPtr.Zero ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_CreateDIBGraph( string FileName , bool ReverseFlag , [ In ] ref COLORDATA SrcColor ) ;


		/// <summary> ＤＩＢグラフィックをメモリイメージから作成する </summary>
		/// <param name="BmpInfo"> BITMAPINFO * </param>
		/// <returns> HBITMAP </returns>
		public static IntPtr CreateDIBGraphToMem( IntPtr BmpInfo , IntPtr GraphData , bool ReverseFlag , COLORDATA SrcColor )
		{
			lock( locker )
			{
				IntPtr result = dx_CreateDIBGraphToMem( BmpInfo , GraphData , ReverseFlag , ref SrcColor ) ;
				if( !( result != IntPtr.Zero ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_CreateDIBGraphToMem( IntPtr BmpInfo , IntPtr GraphData , bool ReverseFlag , [ In ] ref COLORDATA SrcColor ) ;


		/// <summary> ファイルからＤＩＢグラフィックとマスクグラフィックを作成する </summary>
		/// <param name="RGBBmp"> HBITMAP * </param>
		/// <param name="AlphaBmp"> HBITMAP * </param>
		public static void CreateDIBGraph_plus_Alpha( string FileName , out IntPtr RGBBmp , out IntPtr AlphaBmp )
		{
			CreateDIBGraph_plus_Alpha( FileName , out RGBBmp , out AlphaBmp , false ) ;
		}

		/// <summary> ファイルからＤＩＢグラフィックとマスクグラフィックを作成する </summary>
		/// <param name="RGBBmp"> HBITMAP * </param>
		/// <param name="AlphaBmp"> HBITMAP * </param>
		public static void CreateDIBGraph_plus_Alpha( string FileName , out IntPtr RGBBmp , out IntPtr AlphaBmp , bool ReverseFlag )
		{
			lock( locker )
			{
				int result = dx_CreateDIBGraph_plus_Alpha( FileName , out RGBBmp , out AlphaBmp , ReverseFlag , IntPtr.Zero ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

		/// <summary> ファイルからＤＩＢグラフィックとマスクグラフィックを作成する </summary>
		/// <param name="RGBBmp"> HBITMAP * </param>
		/// <param name="AlphaBmp"> HBITMAP * </param>
		public static void CreateDIBGraph_plus_Alpha( string FileName , out IntPtr RGBBmp , out IntPtr AlphaBmp , bool ReverseFlag , COLORDATA SrcColor )
		{
			lock( locker )
			{
				int result = dx_CreateDIBGraph_plus_Alpha( FileName , out RGBBmp , out AlphaBmp , ReverseFlag , ref SrcColor ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateDIBGraph_plus_Alpha( string FileName , out IntPtr RGBBmp , out IntPtr AlphaBmp , bool ReverseFlag , IntPtr SrcColor ) ;

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateDIBGraph_plus_Alpha( string FileName , out IntPtr RGBBmp , out IntPtr AlphaBmp , bool ReverseFlag , [ In ] ref COLORDATA SrcColor ) ;



		/// <summary> ユーザー定義のグラフィックロード関数Ver4を登録する </summary>
		public static void AddUserGraphLoadFunction4( UserGraphLoadFunction4 UserLoadFunc )
		{
			lock( locker )
			{
				USERGRAPHLOADFUNCTION4 UserLoadFunc_ = delegate( ref STREAMDATA Src , out BASEIMAGE Image )
				{
					return UserLoadFunc( new StreamData( Src ) , out Image ) ? 0 : -1 ;
				} ;
				UserGraphLoadFunction4s.Add( UserLoadFunc , UserLoadFunc_ ) ;
				int result = dx_AddUserGraphLoadFunction4( UserLoadFunc_ ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AddUserGraphLoadFunction4( [ MarshalAs( UnmanagedType.FunctionPtr ) ] USERGRAPHLOADFUNCTION4 UserLoadFunc ) ;


		/// <summary> ユーザー定義のグラフィックロード関数Ver4を登録から抹消する </summary>
		public static void SubUserGraphLoadFunction4( UserGraphLoadFunction4 UserLoadFunc )
		{
			lock( locker )
			{
				int result = dx_SubUserGraphLoadFunction4( UserLoadFunc ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				UserGraphLoadFunction4s.Remove( UserLoadFunc ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SubUserGraphLoadFunction4( [ MarshalAs( UnmanagedType.FunctionPtr ) ] UserGraphLoadFunction4 UserLoadFunc ) ;


		private static SortedDictionary< UserGraphLoadFunction4 , USERGRAPHLOADFUNCTION4 > UserGraphLoadFunction4s = new SortedDictionary< UserGraphLoadFunction4 , USERGRAPHLOADFUNCTION4 >() ;

	#if UNICODE
		[ UnmanagedFunctionPointer( CallingConvention.Cdecl , CharSet = CharSet.Unicode ) ]
	#else
		[ UnmanagedFunctionPointer( CallingConvention.Cdecl , CharSet = CharSet.Ansi ) ]
	#endif
		private delegate int USERGRAPHLOADFUNCTION4( [ In ] ref STREAMDATA Src , out BASEIMAGE Image ) ;


		/// <summary> 高速読み込みルーチンを使うか否かのフラグをセットする </summary>
		public static void SetUseFastLoadFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetUseFastLoadFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUseFastLoadFlag( bool Flag ) ;


		/// <summary> グラフィック減色時の画像劣化緩和処理モードの取得 </summary>
		public static DX_SHAVEDMODE GetGraphDataShavedMode()
		{
			lock( locker )
			{
				DX_SHAVEDMODE result = dx_GetGraphDataShavedMode() ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern DX_SHAVEDMODE dx_GetGraphDataShavedMode() ;


		/// <summary> グラフィック減色時の画像劣化緩和処理モードの変更 </summary>
		public static void SetGraphDataShavedMode( DX_SHAVEDMODE ShavedMode )
		{
			lock( locker )
			{
				int result = dx_SetGraphDataShavedMode( ShavedMode ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetGraphDataShavedMode( DX_SHAVEDMODE ShavedMode ) ;


		/// <summary> ソフトウエアで扱うイメージの読み込み( -1:エラー  -1以外:イメージハンドル ) </summary>
		public static SoftImage LoadSoftImage( string FileName )
		{
			lock( locker )
			{
				int result = dx_LoadSoftImage( FileName ) ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return SoftImage.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_LoadSoftImage( string FileName ) ;


		/// <summary> ソフトウエアで扱うイメージのメモリからの読み込み( -1:エラー  -1以外:イメージハンドル ) </summary>
		public static SoftImage LoadSoftImageToMem( IntPtr FileImage , int FileImageSize )
		{
			lock( locker )
			{
				int result = dx_LoadSoftImageToMem( FileImage , FileImageSize ) ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return SoftImage.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_LoadSoftImageToMem( IntPtr FileImage , int FileImageSize ) ;


		/// <summary> ソフトウエアで扱うイメージの作成( -1:エラー  -1以外:イメージハンドル ) </summary>
		public static SoftImage MakeSoftImage( int SizeX , int SizeY )
		{
			lock( locker )
			{
				int result = dx_MakeSoftImage( SizeX , SizeY ) ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return SoftImage.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_MakeSoftImage( int SizeX , int SizeY ) ;


		/// <summary> ソフトウエアで扱うイメージの作成( RGBA8 カラー ) </summary>
		public static SoftImage MakeARGB8ColorSoftImage( int SizeX , int SizeY )
		{
			lock( locker )
			{
				int result = dx_MakeARGB8ColorSoftImage( SizeX , SizeY ) ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return SoftImage.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_MakeARGB8ColorSoftImage( int SizeX , int SizeY ) ;


		/// <summary> ソフトウエアで扱うイメージの作成( XRGB8 カラー ) </summary>
		public static SoftImage MakeXRGB8ColorSoftImage( int SizeX , int SizeY )
		{
			lock( locker )
			{
				int result = dx_MakeXRGB8ColorSoftImage( SizeX , SizeY ) ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return SoftImage.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_MakeXRGB8ColorSoftImage( int SizeX , int SizeY ) ;


		/// <summary> ソフトウエアで扱うイメージの作成( RGB8 カラー ) </summary>
		public static SoftImage MakeRGB8ColorSoftImage( int SizeX , int SizeY )
		{
			lock( locker )
			{
				int result = dx_MakeRGB8ColorSoftImage( SizeX , SizeY ) ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return SoftImage.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_MakeRGB8ColorSoftImage( int SizeX , int SizeY ) ;


		/// <summary> ソフトウエアで扱うイメージの作成( パレット２５６色 カラー ) </summary>
		public static SoftImage MakePAL8ColorSoftImage( int SizeX , int SizeY )
		{
			lock( locker )
			{
				int result = dx_MakePAL8ColorSoftImage( SizeX , SizeY ) ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return SoftImage.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_MakePAL8ColorSoftImage( int SizeX , int SizeY ) ;


		/// <summary> ソフトウエアで扱うイメージのサイズを取得する </summary>
		public static void GetSoftImageSize( SoftImage SIHandle , out int Width , out int Height )
		{
			lock( locker )
			{
				int result = dx_GetSoftImageSize( SoftImage.ToHandle( SIHandle ) , out Width , out Height ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetSoftImageSize( int SIHandle , out int Width , out int Height ) ;


		/// <summary> ソフトウエアで扱うイメージがパレット画像かどうかを取得する( TRUE:パレット画像  FALSE:パレット画像じゃない ) </summary>
		public static bool CheckPaletteSoftImage( SoftImage SIHandle )
		{
			lock( locker )
			{
				int result = dx_CheckPaletteSoftImage( SoftImage.ToHandle( SIHandle ) ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CheckPaletteSoftImage( int SIHandle ) ;


		/// <summary> ソフトウエアで扱うイメージのフォーマットにα要素があるかどうかを取得する( TRUE:ある  FALSE:ない ) </summary>
		public static bool CheckAlphaSoftImage( SoftImage SIHandle )
		{
			lock( locker )
			{
				int result = dx_CheckAlphaSoftImage( SoftImage.ToHandle( SIHandle ) ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CheckAlphaSoftImage( int SIHandle ) ;


		/// <summary> 描画対象の画面から指定領域のグラフィックをソフトウエアで扱うイメージに転送する </summary>
		public static void GetDrawScreenSoftImage( int x1 , int y1 , int x2 , int y2 , SoftImage SIHandle )
		{
			lock( locker )
			{
				int result = dx_GetDrawScreenSoftImage( x1 , y1 , x2 , y2 , SoftImage.ToHandle( SIHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetDrawScreenSoftImage( int x1 , int y1 , int x2 , int y2 , int SIHandle ) ;


		/// <summary> ソフトウエアで扱うイメージを使用して UpdateLayerdWindow を行う( イメージはウインドウのクライアント領域と同じサイズである必要があります ) </summary>
		public static void UpdateLayerdWindowForSoftImage( SoftImage SIHandle )
		{
			lock( locker )
			{
				int result = dx_UpdateLayerdWindowForSoftImage( SoftImage.ToHandle( SIHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_UpdateLayerdWindowForSoftImage( int SIHandle ) ;


		/// <summary> ソフトウエアで扱うイメージを指定色で塗りつぶす(各色要素は０〜２５５) </summary>
		public static void FillSoftImage( SoftImage SIHandle , int r , int g , int b , int a )
		{
			lock( locker )
			{
				int result = dx_FillSoftImage( SoftImage.ToHandle( SIHandle ) , r , g , b , a ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FillSoftImage( int SIHandle , int r , int g , int b , int a ) ;


		/// <summary> ソフトウエアで扱うイメージのパレットを取得する(各色要素は０〜２５５) </summary>
		public static void GetPaletteSoftImage( SoftImage SIHandle , int PaletteNo , out int r , out int g , out int b , out int a )
		{
			lock( locker )
			{
				int result = dx_GetPaletteSoftImage( SoftImage.ToHandle( SIHandle ) , PaletteNo , out r , out g , out b , out a ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetPaletteSoftImage( int SIHandle , int PaletteNo , out int r , out int g , out int b , out int a ) ;


		/// <summary> ソフトウエアで扱うイメージのパレットをセットする(各色要素は０〜２５５) </summary>
		public static void SetPaletteSoftImage( SoftImage SIHandle , int PaletteNo , int r , int g , int b , int a )
		{
			lock( locker )
			{
				int result = dx_SetPaletteSoftImage( SoftImage.ToHandle( SIHandle ) , PaletteNo , r , g , b , a ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetPaletteSoftImage( int SIHandle , int PaletteNo , int r , int g , int b , int a ) ;


		/// <summary> ソフトウエアで扱うイメージの指定座標にドットを描画する(パレット画像用、有効値は０〜２５５) </summary>
		public static void DrawPixelPalCodeSoftImage( SoftImage SIHandle , int x , int y , int PalNo )
		{
			lock( locker )
			{
				int result = dx_DrawPixelPalCodeSoftImage( SoftImage.ToHandle( SIHandle ) , x , y , PalNo ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DrawPixelPalCodeSoftImage( int SIHandle , int x , int y , int PalNo ) ;


		/// <summary> ソフトウエアで扱うイメージの指定座標の色コードを取得する(パレット画像用、戻り値は０〜２５５) </summary>
		public static int GetPixelPalCodeSoftImage( SoftImage SIHandle , int x , int y )
		{
			lock( locker )
			{
				int result = dx_GetPixelPalCodeSoftImage( SoftImage.ToHandle( SIHandle ) , x , y ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetPixelPalCodeSoftImage( int SIHandle , int x , int y ) ;


		/// <summary> ソフトウエアで扱うイメージの実イメージが格納されているメモリ領域の先頭アドレスを取得する </summary>
		public static IntPtr GetImageAddressSoftImage( SoftImage SIHandle )
		{
			lock( locker )
			{
				IntPtr result = dx_GetImageAddressSoftImage( SoftImage.ToHandle( SIHandle ) ) ;
				if( !( result != IntPtr.Zero ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_GetImageAddressSoftImage( int SIHandle ) ;


		/// <summary> ソフトウエアで扱うイメージの指定座標にドットを描画する(各色要素は０〜２５５) </summary>
		public static void DrawPixelSoftImage( SoftImage SIHandle , int x , int y , int r , int g , int b , int a )
		{
			lock( locker )
			{
				int result = dx_DrawPixelSoftImage( SoftImage.ToHandle( SIHandle ) , x , y , r , g , b , a ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DrawPixelSoftImage( int SIHandle , int x , int y , int r , int g , int b , int a ) ;


		/// <summary> ソフトウエアで扱うイメージの指定座標の色を取得する(各色要素は０〜２５５) </summary>
		public static void GetPixelSoftImage( SoftImage SIHandle , int x , int y , out int r , out int g , out int b , out int a )
		{
			lock( locker )
			{
				int result = dx_GetPixelSoftImage( SoftImage.ToHandle( SIHandle ) , x , y , out r , out g , out b , out a ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetPixelSoftImage( int SIHandle , int x , int y , out int r , out int g , out int b , out int a ) ;


		/// <summary> ソフトウエアで扱うイメージの指定座標に線を描画する(各色要素は０〜２５５) </summary>
		public static void DrawLineSoftImage( SoftImage SIHandle , int x1 , int y1 , int x2 , int y2 , int r , int g , int b , int a )
		{
			lock( locker )
			{
				int result = dx_DrawLineSoftImage( SoftImage.ToHandle( SIHandle ) , x1 , y1 , x2 , y2 , r , g , b , a ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DrawLineSoftImage( int SIHandle , int x1 , int y1 , int x2 , int y2 , int r , int g , int b , int a ) ;


		/// <summary> ソフトウエアで扱うイメージを別のイメージ上に転送する </summary>
		public static void BltSoftImage( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , SoftImage SrcSIHandle , int DestX , int DestY , SoftImage DestSIHandle )
		{
			lock( locker )
			{
				int result = dx_BltSoftImage( SrcX , SrcY , SrcSizeX , SrcSizeY , SoftImage.ToHandle( SrcSIHandle ) , DestX , DestY , SoftImage.ToHandle( DestSIHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_BltSoftImage( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , int SrcSIHandle , int DestX , int DestY , int DestSIHandle ) ;


		/// <summary> ソフトウエアで扱うイメージを透過色処理付きで転送する </summary>
		public static void BltSoftImageWithTransColor( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , SoftImage SrcSIHandle , int DestX , int DestY , SoftImage DestSIHandle , int Tr , int Tg , int Tb , int Ta )
		{
			lock( locker )
			{
				int result = dx_BltSoftImageWithTransColor( SrcX , SrcY , SrcSizeX , SrcSizeY , SoftImage.ToHandle( SrcSIHandle ) , DestX , DestY , SoftImage.ToHandle( DestSIHandle ) , Tr , Tg , Tb , Ta ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_BltSoftImageWithTransColor( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , int SrcSIHandle , int DestX , int DestY , int DestSIHandle , int Tr , int Tg , int Tb , int Ta ) ;


		/// <summary> ソフトウエアで扱うイメージをアルファ値のブレンドを考慮した上で転送する( Opacity は透明度 : 0( 完全透明 ) 〜 255( 完全不透明 ) )( 出力先が ARGB8 形式以外の場合はエラーになります ) </summary>
		public static void BltSoftImageWithAlphaBlend( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , SoftImage SrcSIHandle , int DestX , int DestY , SoftImage DestSIHandle )
		{
			BltSoftImageWithAlphaBlend( SrcX , SrcY , SrcSizeX , SrcSizeY , SrcSIHandle , DestX , DestY , DestSIHandle , 255 ) ;
		}

		/// <summary> ソフトウエアで扱うイメージをアルファ値のブレンドを考慮した上で転送する( Opacity は透明度 : 0( 完全透明 ) 〜 255( 完全不透明 ) )( 出力先が ARGB8 形式以外の場合はエラーになります ) </summary>
		public static void BltSoftImageWithAlphaBlend( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , SoftImage SrcSIHandle , int DestX , int DestY , SoftImage DestSIHandle , int Opacity )
		{
			lock( locker )
			{
				int result = dx_BltSoftImageWithAlphaBlend( SrcX , SrcY , SrcSizeX , SrcSizeY , SoftImage.ToHandle( SrcSIHandle ) , DestX , DestY , SoftImage.ToHandle( DestSIHandle ) , Opacity ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_BltSoftImageWithAlphaBlend( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , int SrcSIHandle , int DestX , int DestY , int DestSIHandle , int Opacity ) ;


		/// <summary> ソフトウエアで扱うイメージに文字列イメージを転送する </summary>
		public static void BltStringSoftImage( int x , int y , string StrData , SoftImage DestSIHandle )
		{
			BltStringSoftImage( x , y , StrData , DestSIHandle , null ) ;
		}

		/// <summary> ソフトウエアで扱うイメージに文字列イメージを転送する </summary>
		public static void BltStringSoftImage( int x , int y , string StrData , SoftImage DestSIHandle , SoftImage DestEdgeSIHandle )
		{
			BltStringSoftImage( x , y , StrData , DestSIHandle , DestEdgeSIHandle , false ) ;
		}

		/// <summary> ソフトウエアで扱うイメージに文字列イメージを転送する </summary>
		public static void BltStringSoftImage( int x , int y , string StrData , SoftImage DestSIHandle , SoftImage DestEdgeSIHandle , bool VerticalFlag )
		{
			lock( locker )
			{
				int result = dx_BltStringSoftImage( x , y , StrData , SoftImage.ToHandle( DestSIHandle ) , SoftImage.ToHandle( DestEdgeSIHandle ) , VerticalFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_BltStringSoftImage( int x , int y , string StrData , int DestSIHandle , int DestEdgeSIHandle , bool VerticalFlag ) ;


		/// <summary> ソフトウエアで扱うイメージに文字列イメージを転送する( フォントハンドル使用版 ) </summary>
		/// <param name="DestEdgeSIHandle"> 縁が必要ない場合は -1 </param>
		public static void BltStringSoftImageToHandle( int x , int y , string StrData , SoftImage DestSIHandle , SoftImage DestEdgeSIHandle , Font FontHandle )
		{
			BltStringSoftImageToHandle( x , y , StrData , DestSIHandle , DestEdgeSIHandle , FontHandle , false ) ;
		}

		/// <summary> ソフトウエアで扱うイメージに文字列イメージを転送する( フォントハンドル使用版 ) </summary>
		/// <param name="DestEdgeSIHandle"> 縁が必要ない場合は -1 </param>
		public static void BltStringSoftImageToHandle( int x , int y , string StrData , SoftImage DestSIHandle , SoftImage DestEdgeSIHandle , Font FontHandle , bool VerticalFlag )
		{
			lock( locker )
			{
				int result = dx_BltStringSoftImageToHandle( x , y , StrData , SoftImage.ToHandle( DestSIHandle ) , SoftImage.ToHandle( DestEdgeSIHandle ) , Font.ToHandle( FontHandle ) , VerticalFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_BltStringSoftImageToHandle( int x , int y , string StrData , int DestSIHandle , int DestEdgeSIHandle , int FontHandle , bool VerticalFlag ) ;


		/// <summary> ソフトウエアで扱うイメージを画面に描画する </summary>
		public static void DrawSoftImage( int x , int y , SoftImage SIHandle )
		{
			lock( locker )
			{
				int result = dx_DrawSoftImage( x , y , SoftImage.ToHandle( SIHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DrawSoftImage( int x , int y , int SIHandle ) ;


		/// <summary> ソフトウエアで扱うイメージをＢＭＰ画像ファイルとして保存する </summary>
		public static void SaveSoftImageToBmp( string FilePath , SoftImage SIHandle )
		{
			lock( locker )
			{
				int result = dx_SaveSoftImageToBmp( FilePath , SoftImage.ToHandle( SIHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SaveSoftImageToBmp( string FilePath , int SIHandle ) ;


		/// <summary> ソフトウエアで扱うイメージをＰＮＧ画像ファイルとして保存する CompressionLevel = 圧縮率、値が大きいほど高圧縮率高負荷、０は無圧縮 ,0〜9 </summary>
		public static void SaveSoftImageToPng( string FilePath , SoftImage SIHandle , int CompressionLevel )
		{
			lock( locker )
			{
				int result = dx_SaveSoftImageToPng( FilePath , SoftImage.ToHandle( SIHandle ) , CompressionLevel ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SaveSoftImageToPng( string FilePath , int SIHandle , int CompressionLevel ) ;


		/// <summary> ソフトウエアで扱うイメージをＪＰＥＧ画像ファイルとして保存する Quality = 画質、値が大きいほど低圧縮高画質 ,0〜100  </summary>
		public static void SaveSoftImageToJpeg( string FilePath , SoftImage SIHandle , int Quality , bool Sample2x1 )
		{
			lock( locker )
			{
				int result = dx_SaveSoftImageToJpeg( FilePath , SoftImage.ToHandle( SIHandle ) , Quality , Sample2x1 ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SaveSoftImageToJpeg( string FilePath , int SIHandle , int Quality , bool Sample2x1 ) ;


		/// <summary> 各種グラフィックデータから基本イメージデータを構築する </summary>
		/// <param name="DataType"> =LOADIMAGE_TYPE_FILE </param>
		public static void CreateBaseImage( string FileName , IntPtr FileImage , int FileImageSize , LOADIMAGE_TYPE DataType , out BaseImage BaseImage , bool ReverseFlag )
		{
			lock( locker )
			{
				BASEIMAGE BaseImage_ ;
				int result = dx_CreateBaseImage( FileName , FileImage , FileImageSize , DataType , out BaseImage_ , ReverseFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				BaseImage = new BaseImage( BaseImage_ ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateBaseImage( string FileName , IntPtr FileImage , int FileImageSize , LOADIMAGE_TYPE DataType , out BASEIMAGE BaseImage , bool ReverseFlag ) ;


		/// <summary> CreateBaseImage の旧名称 </summary>
		/// <param name="DataImageType"> =LOADIMAGE_TYPE_FILE </param>
		public static void CreateGraphImage( string FileName , IntPtr DataImage , int DataImageSize , LOADIMAGE_TYPE DataImageType , out BaseImage GraphImage , bool ReverseFlag )
		{
			lock( locker )
			{
				BASEIMAGE BaseImage_ ;
				int result = dx_CreateGraphImage( FileName , DataImage , DataImageSize , DataImageType , out BaseImage_ , ReverseFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				GraphImage = new BaseImage( BaseImage_ ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateGraphImage( string FileName , IntPtr DataImage , int DataImageSize , LOADIMAGE_TYPE DataImageType , out BASEIMAGE GraphImage , bool ReverseFlag ) ;


		/// <summary> 画像ファイルから基本イメージデータを構築する </summary>
		public static void CreateBaseImageToFile( string FileName , out BaseImage BaseImage , bool ReverseFlag )
		{
			lock( locker )
			{
				BASEIMAGE BaseImage_ ;
				int result = dx_CreateBaseImageToFile( FileName , out BaseImage_ , ReverseFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				BaseImage = new BaseImage( BaseImage_ ) ;
			}
		}

		/// <summary> 画像ファイルから基本イメージデータを構築する </summary>
		public static void CreateBaseImageToFile( string FileName , out BaseImage BaseImage )
		{
			CreateBaseImageToFile( FileName , out BaseImage , false ) ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateBaseImageToFile( string FileName , out BASEIMAGE BaseImage , bool ReverseFlag ) ;


		/// <summary> メモリ上に展開された画像ファイルから基本イメージデータを構築する </summary>
		public static void CreateBaseImageToMem( IntPtr FileImage , int FileImageSize , out BaseImage BaseImage , bool ReverseFlag )
		{
			lock( locker )
			{
				BASEIMAGE BaseImage_ ;
				int result = dx_CreateBaseImageToMem( FileImage , FileImageSize , out BaseImage_ , ReverseFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				BaseImage = new BaseImage( BaseImage_ ) ;
			}
		}

		/// <summary> メモリ上に展開された画像ファイルから基本イメージデータを構築する </summary>
		public static void CreateBaseImageToMem( IntPtr FileImage , int FileImageSize , out BaseImage BaseImage )
		{
			CreateBaseImageToMem( FileImage , FileImageSize , out BaseImage , false ) ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateBaseImageToMem( IntPtr FileImage , int FileImageSize , out BASEIMAGE BaseImage , bool ReverseFlag ) ;


		/// <summary> ＡＲＧＢ８カラーの空の基本イメージデータを作成する </summary>
		public static void CreateARGB8ColorBaseImage( int SizeX , int SizeY , out BaseImage BaseImage )
		{
			lock( locker )
			{
				BASEIMAGE BaseImage_ ;
				int result = dx_CreateARGB8ColorBaseImage( SizeX , SizeY , out BaseImage_ ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				BaseImage = new BaseImage( BaseImage_ ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateARGB8ColorBaseImage( int SizeX , int SizeY , out BASEIMAGE BaseImage ) ;


		/// <summary> ＸＲＧＢ８カラーの空の基本イメージデータを作成する </summary>
		public static void CreateXRGB8ColorBaseImage( int SizeX , int SizeY , out BaseImage BaseImage )
		{
			lock( locker )
			{
				BASEIMAGE BaseImage_ ;
				int result = dx_CreateXRGB8ColorBaseImage( SizeX , SizeY , out BaseImage_ ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				BaseImage = new BaseImage( BaseImage_ ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateXRGB8ColorBaseImage( int SizeX , int SizeY , out BASEIMAGE BaseImage ) ;


		/// <summary> ＲＧＢ８カラーの空の基本イメージデータを作成する </summary>
		public static void CreateRGB8ColorBaseImage( int SizeX , int SizeY , out BaseImage BaseImage )
		{
			lock( locker )
			{
				BASEIMAGE BaseImage_ ;
				int result = dx_CreateRGB8ColorBaseImage( SizeX , SizeY , out BaseImage_ ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				BaseImage = new BaseImage( BaseImage_ ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateRGB8ColorBaseImage( int SizeX , int SizeY , out BASEIMAGE BaseImage ) ;


		/// <summary> パレット８ビットカラーの空の基本イメージデータを作成する </summary>
		public static void CreatePAL8ColorBaseImage( int SizeX , int SizeY , out BaseImage BaseImage )
		{
			lock( locker )
			{
				BASEIMAGE BaseImage_ ;
				int result = dx_CreatePAL8ColorBaseImage( SizeX , SizeY , out BaseImage_ ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				BaseImage = new BaseImage( BaseImage_ ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreatePAL8ColorBaseImage( int SizeX , int SizeY , out BASEIMAGE BaseImage ) ;


		/// <summary> 指定のカラーフォーマットの殻の基本イメージデータを作成する </summary>
		public static void CreateColorDataBaseImage( int SizeX , int SizeY , COLORDATA ColorData , out BaseImage BaseImage )
		{
			lock( locker )
			{
				BASEIMAGE BaseImage_ ;
				int result = dx_CreateColorDataBaseImage( SizeX , SizeY , ref ColorData , out BaseImage_ ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				BaseImage = new BaseImage( BaseImage_ ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateColorDataBaseImage( int SizeX , int SizeY , [ In ] ref COLORDATA ColorData , out BASEIMAGE BaseImage ) ;


		/// <summary> DX_BASEIMAGE_FORMAT_NORMAL 以外の形式のイメージデータを DX_BASEIMAGE_FORMAT_NORMAL 形式のイメージに変換する </summary>
		public static void ConvertNormalFormatBaseImage( BaseImage BaseImage )
		{
			lock( locker )
			{
				int result = dx_ConvertNormalFormatBaseImage( ref BaseImage.buffer ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ConvertNormalFormatBaseImage( [ In , Out ] ref BASEIMAGE BaseImage ) ;


		/// <summary> 描画対象の画面から指定領域のグラフィックを基本イメージデータに転送する </summary>
		public static void GetDrawScreenBaseImage( int x1 , int y1 , int x2 , int y2 , BaseImage BaseImage )
		{
			lock( locker )
			{
				int result = dx_GetDrawScreenBaseImage( x1 , y1 , x2 , y2 , ref BaseImage.buffer ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetDrawScreenBaseImage( int x1 , int y1 , int x2 , int y2 , [ In , Out ] ref BASEIMAGE BaseImage ) ;


		/// <summary> 基本イメージを使用して UpdateLayerdWindow を行う </summary>
		public static void UpdateLayerdWindowForBaseImage( BaseImage BaseImage )
		{
			lock( locker )
			{
				int result = dx_UpdateLayerdWindowForBaseImage( ref BaseImage.buffer ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_UpdateLayerdWindowForBaseImage( [ In ] ref BASEIMAGE BaseImage ) ;


		/// <summary> 基本イメージデータを指定の色で塗りつぶす </summary>
		public static void FillBaseImage( BaseImage BaseImage , int r , int g , int b , int a )
		{
			lock( locker )
			{
				int result = dx_FillBaseImage( ref BaseImage.buffer , r , g , b , a ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FillBaseImage( [ In , Out ] ref BASEIMAGE BaseImage , int r , int g , int b , int a ) ;


		/// <summary> 基本イメージデータの指定の領域を０クリアする </summary>
		public static void ClearRectBaseImage( BaseImage BaseImage , int x , int y , int w , int h )
		{
			lock( locker )
			{
				int result = dx_ClearRectBaseImage( ref BaseImage.buffer , x , y , w , h ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ClearRectBaseImage( [ In , Out ] ref BASEIMAGE BaseImage , int x , int y , int w , int h ) ;


		/// <summary> 基本イメージデータのパレットを取得する </summary>
		public static void GetPaletteBaseImage( BaseImage BaseImage , int PaletteNo , out int r , out int g , out int b , out int a )
		{
			lock( locker )
			{
				int result = dx_GetPaletteBaseImage( ref BaseImage.buffer , PaletteNo , out r , out g , out b , out a ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetPaletteBaseImage( [ In ] ref BASEIMAGE BaseImage , int PaletteNo , out int r , out int g , out int b , out int a ) ;


		/// <summary> 基本イメージデータのパレットをセットする </summary>
		public static void SetPaletteBaseImage( BaseImage BaseImage , int PaletteNo , int r , int g , int b , int a )
		{
			lock( locker )
			{
				int result = dx_SetPaletteBaseImage( ref BaseImage.buffer , PaletteNo , r , g , b , a ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetPaletteBaseImage( [ In , Out ] ref BASEIMAGE BaseImage , int PaletteNo , int r , int g , int b , int a ) ;


		/// <summary> 基本イメージデータの指定の座標の色コードを変更する(パレット画像用) </summary>
		public static void SetPixelPalCodeBaseImage( BaseImage BaseImage , int x , int y , int PalNo )
		{
			lock( locker )
			{
				int result = dx_SetPixelPalCodeBaseImage( ref BaseImage.buffer , x , y , PalNo ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetPixelPalCodeBaseImage( [ In , Out ] ref BASEIMAGE BaseImage , int x , int y , int PalNo ) ;


		/// <summary> 基本イメージデータの指定の座標の色コードを取得する(パレット画像用) </summary>
		public static int GetPixelPalCodeBaseImage( BaseImage BaseImage , int x , int y )
		{
			lock( locker )
			{
				int result = dx_GetPixelPalCodeBaseImage( ref BaseImage.buffer , x , y ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetPixelPalCodeBaseImage( [ In ] ref BASEIMAGE BaseImage , int x , int y ) ;


		/// <summary> 基本イメージデータの指定の座標の色を変更する(各色要素は０〜２５５) </summary>
		public static void SetPixelBaseImage( BaseImage BaseImage , int x , int y , int r , int g , int b , int a )
		{
			lock( locker )
			{
				int result = dx_SetPixelBaseImage( ref BaseImage.buffer , x , y , r , g , b , a ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetPixelBaseImage( [ In , Out ] ref BASEIMAGE BaseImage , int x , int y , int r , int g , int b , int a ) ;


		/// <summary> 基本イメージデータの指定の座標の色を取得する(各色要素は０〜２５５) </summary>
		public static void GetPixelBaseImage( BaseImage BaseImage , int x , int y , out int r , out int g , out int b , out int a )
		{
			lock( locker )
			{
				int result = dx_GetPixelBaseImage( ref BaseImage.buffer , x , y , out r , out g , out b , out a ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetPixelBaseImage( [ In ] ref BASEIMAGE BaseImage , int x , int y , out int r , out int g , out int b , out int a ) ;


		/// <summary> 基本イメージデータの指定の座標に線を描画する(各色要素は０〜２５５) </summary>
		public static void DrawLineBaseImage( BaseImage BaseImage , int x1 , int y1 , int x2 , int y2 , int r , int g , int b , int a )
		{
			lock( locker )
			{
				int result = dx_DrawLineBaseImage( ref BaseImage.buffer , x1 , y1 , x2 , y2 , r , g , b , a ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DrawLineBaseImage( [ In ] ref BASEIMAGE BaseImage , int x1 , int y1 , int x2 , int y2 , int r , int g , int b , int a ) ;


		/// <summary> 基本イメージデータを転送する </summary>
		public static void BltBaseImage( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , int DestX , int DestY , BaseImage SrcBaseImage , BaseImage DestBaseImage )
		{
			lock( locker )
			{
				int result = dx_BltBaseImage( SrcX , SrcY , SrcSizeX , SrcSizeY , DestX , DestY , ref SrcBaseImage.buffer , ref DestBaseImage.buffer ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_BltBaseImage( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , int DestX , int DestY , [ In ] ref BASEIMAGE SrcBaseImage , [ In , Out ] ref BASEIMAGE DestBaseImage ) ;


		/// <summary> 基本イメージデータを転送する </summary>
		public static void BltBaseImage( int DestX , int DestY , BaseImage SrcBaseImage , BaseImage DestBaseImage )
		{
			lock( locker )
			{
				int result = dx_BltBaseImage_2( DestX , DestY , ref SrcBaseImage.buffer , ref DestBaseImage.buffer ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_BltBaseImage_2( int DestX , int DestY , [ In ] ref BASEIMAGE SrcBaseImage , [ In , Out ] ref BASEIMAGE DestBaseImage ) ;


		/// <summary> 基本イメージデータを透過色処理付きで転送する </summary>
		public static void BltBaseImageWithTransColor( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , int DestX , int DestY , BaseImage SrcBaseImage , BaseImage DestBaseImage , int Tr , int Tg , int Tb , int Ta )
		{
			lock( locker )
			{
				int result = dx_BltBaseImageWithTransColor( SrcX , SrcY , SrcSizeX , SrcSizeY , DestX , DestY , ref SrcBaseImage.buffer , ref DestBaseImage.buffer , Tr , Tg , Tb , Ta ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_BltBaseImageWithTransColor( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , int DestX , int DestY , [ In ] ref BASEIMAGE SrcBaseImage , [ In , Out ] ref BASEIMAGE DestBaseImage , int Tr , int Tg , int Tb , int Ta ) ;


		/// <summary> 基本イメージデータをアルファ値のブレンドを考慮した上で転送する( Opacity は透明度 : 0( 完全透明 ) 〜 255( 完全不透明 ) )( 出力先が ARGB8 形式以外の場合はエラーになります ) </summary>
		public static void BltBaseImageWithAlphaBlend( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , int DestX , int DestY , BaseImage SrcBaseImage , BaseImage DestBaseImage , int Opacity )
		{
			lock( locker )
			{
				int result = dx_BltBaseImageWithAlphaBlend( SrcX , SrcY , SrcSizeX , SrcSizeY , DestX , DestY , ref SrcBaseImage.buffer , ref DestBaseImage.buffer , Opacity ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

		/// <summary> 基本イメージデータをアルファ値のブレンドを考慮した上で転送する( Opacity は透明度 : 0( 完全透明 ) 〜 255( 完全不透明 ) )( 出力先が ARGB8 形式以外の場合はエラーになります ) </summary>
		public static void BltBaseImageWithAlphaBlend( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , int DestX , int DestY , BaseImage SrcBaseImage , BaseImage DestBaseImage )
		{
			BltBaseImageWithAlphaBlend( SrcX , SrcY , SrcSizeX , SrcSizeY , DestX , DestY , SrcBaseImage , DestBaseImage , 255 ) ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_BltBaseImageWithAlphaBlend( int SrcX , int SrcY , int SrcSizeX , int SrcSizeY , int DestX , int DestY , [ In ] ref BASEIMAGE SrcBaseImage , [ In , Out ] ref BASEIMAGE DestBaseImage , int Opacity ) ;


		/// <summary> 基本画像データをＢＭＰ画像として保存する </summary>
		public static void SaveBaseImageToBmp( string FilePath , BaseImage BaseImage )
		{
			lock( locker )
			{
				int result = dx_SaveBaseImageToBmp( FilePath , ref BaseImage.buffer ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SaveBaseImageToBmp( string FilePath , [ In ] ref BASEIMAGE BaseImage ) ;


		/// <summary> 基本画像データをＰＮＧ画像として保存する </summary>
		public static void SaveBaseImageToPng( string FilePath , BaseImage BaseImage , int CompressionLevel )
		{
			lock( locker )
			{
				int result = dx_SaveBaseImageToPng( FilePath , ref BaseImage.buffer , CompressionLevel ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SaveBaseImageToPng( string FilePath , [ In ] ref BASEIMAGE BaseImage , int CompressionLevel ) ;


		/// <summary> 基本画像データをＪＰＥＧ画像として保存する </summary>
		public static void SaveBaseImageToJpeg( string FilePath , BaseImage BaseImage , int Quality , bool Sample2x1 )
		{
			lock( locker )
			{
				int result = dx_SaveBaseImageToJpeg( FilePath , ref BaseImage.buffer , Quality , Sample2x1 ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SaveBaseImageToJpeg( string FilePath , [ In ] ref BASEIMAGE BaseImage , int Quality , bool Sample2x1 ) ;

		
		/// <summary> カラーマッチングしながらグラフィックデータ間転送を行う Ver2 </summary>
		public static void GraphColorMatchBltVer2( IntPtr DestGraphData , int DestPitch , COLORDATA DestColorData , IntPtr SrcGraphData , int SrcPitch , COLORDATA SrcColorData , IntPtr AlphaMask , int AlphaPitch , COLORDATA AlphaColorData , POINT DestPoint , RECT SrcRect , bool ReverseFlag , bool TransColorAlphaTestFlag , COLOR_U8 TransColor , DX_SHAVEDMODE ImageShavedMode , bool AlphaOnlyFlag , bool RedIsAlphaFlag , bool TransColorNoMoveFlag )
		{
			GraphColorMatchBltVer2( DestGraphData , DestPitch , DestColorData , SrcGraphData , SrcPitch , SrcColorData , AlphaMask , AlphaPitch , AlphaColorData , DestPoint , SrcRect , ReverseFlag , TransColorAlphaTestFlag , TransColor , ImageShavedMode , AlphaOnlyFlag , RedIsAlphaFlag , TransColorNoMoveFlag , false ) ;
		}

		/// <summary> カラーマッチングしながらグラフィックデータ間転送を行う Ver2 </summary>
		public static void GraphColorMatchBltVer2( IntPtr DestGraphData , int DestPitch , COLORDATA DestColorData , IntPtr SrcGraphData , int SrcPitch , COLORDATA SrcColorData , IntPtr AlphaMask , int AlphaPitch , COLORDATA AlphaColorData , POINT DestPoint , RECT SrcRect , bool ReverseFlag , bool TransColorAlphaTestFlag , COLOR_U8 TransColor , DX_SHAVEDMODE ImageShavedMode , bool AlphaOnlyFlag , bool RedIsAlphaFlag )
		{
			GraphColorMatchBltVer2( DestGraphData , DestPitch , DestColorData , SrcGraphData , SrcPitch , SrcColorData , AlphaMask , AlphaPitch , AlphaColorData , DestPoint , SrcRect , ReverseFlag , TransColorAlphaTestFlag , TransColor , ImageShavedMode , AlphaOnlyFlag , RedIsAlphaFlag , false ) ;
		}

		/// <summary> カラーマッチングしながらグラフィックデータ間転送を行う Ver2 </summary>
		public static void GraphColorMatchBltVer2( IntPtr DestGraphData , int DestPitch , COLORDATA DestColorData , IntPtr SrcGraphData , int SrcPitch , COLORDATA SrcColorData , IntPtr AlphaMask , int AlphaPitch , COLORDATA AlphaColorData , POINT DestPoint , RECT SrcRect , bool ReverseFlag , bool TransColorAlphaTestFlag , COLOR_U8 TransColor , DX_SHAVEDMODE ImageShavedMode , bool AlphaOnlyFlag )
		{
			GraphColorMatchBltVer2( DestGraphData , DestPitch , DestColorData , SrcGraphData , SrcPitch , SrcColorData , AlphaMask , AlphaPitch , AlphaColorData , DestPoint , SrcRect , ReverseFlag , TransColorAlphaTestFlag , TransColor , ImageShavedMode , AlphaOnlyFlag , false ) ;
		}

		/// <summary> カラーマッチングしながらグラフィックデータ間転送を行う Ver2 </summary>
		public static void GraphColorMatchBltVer2( IntPtr DestGraphData , int DestPitch , COLORDATA DestColorData , IntPtr SrcGraphData , int SrcPitch , COLORDATA SrcColorData , IntPtr AlphaMask , int AlphaPitch , COLORDATA AlphaColorData , POINT DestPoint , RECT SrcRect , bool ReverseFlag , bool TransColorAlphaTestFlag , COLOR_U8 TransColor , DX_SHAVEDMODE ImageShavedMode )
		{
			GraphColorMatchBltVer2( DestGraphData , DestPitch , DestColorData , SrcGraphData , SrcPitch , SrcColorData , AlphaMask , AlphaPitch , AlphaColorData , DestPoint , SrcRect , ReverseFlag , TransColorAlphaTestFlag , TransColor , ImageShavedMode , false ) ;
		}

		/// <summary> カラーマッチングしながらグラフィックデータ間転送を行う Ver2 </summary>
		public static void GraphColorMatchBltVer2( IntPtr DestGraphData , int DestPitch , COLORDATA DestColorData , IntPtr SrcGraphData , int SrcPitch , COLORDATA SrcColorData , IntPtr AlphaMask , int AlphaPitch , COLORDATA AlphaColorData , POINT DestPoint , RECT SrcRect , bool ReverseFlag , bool TransColorAlphaTestFlag , COLOR_U8 TransColor , DX_SHAVEDMODE ImageShavedMode , bool AlphaOnlyFlag , bool RedIsAlphaFlag , bool TransColorNoMoveFlag , bool Pal8ColorMatch )
		{
			lock( locker )
			{
				int result = dx_GraphColorMatchBltVer2( DestGraphData , DestPitch , ref DestColorData , SrcGraphData , SrcPitch , ref SrcColorData , AlphaMask , AlphaPitch ,ref AlphaColorData , DestPoint , ref SrcRect , ReverseFlag , TransColorAlphaTestFlag , TransColor , ImageShavedMode , AlphaOnlyFlag , RedIsAlphaFlag , TransColorNoMoveFlag , Pal8ColorMatch ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GraphColorMatchBltVer2( IntPtr DestGraphData , int DestPitch , [ In ] ref COLORDATA DestColorData , IntPtr SrcGraphData , int SrcPitch , [ In ] ref COLORDATA SrcColorData , IntPtr AlphaMask , int AlphaPitch , [ In ] ref COLORDATA AlphaColorData , POINT DestPoint , [ In ] ref RECT SrcRect , bool ReverseFlag , bool TransColorAlphaTestFlag , COLOR_U8 TransColor , DX_SHAVEDMODE ImageShavedMode , bool AlphaOnlyFlag , bool RedIsAlphaFlag , bool TransColorNoMoveFlag , bool Pal8ColorMatch ) ;


		/// <summary> 不動小数点型のカラー値を作成する </summary>
		public static COLOR_F GetColorF( float Red , float Green , float Blue , float Alpha )
		{
			lock( locker )
			{
				COLOR_F result = dx_GetColorF( Red , Green , Blue , Alpha ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern COLOR_F dx_GetColorF( float Red , float Green , float Blue , float Alpha ) ;


		/// <summary> 符号なし整数８ビットのカラー値を作成する </summary>
		public static COLOR_U8 GetColorU8( int Red , int Green , int Blue , int Alpha )
		{
			lock( locker )
			{
				COLOR_U8 result = dx_GetColorU8( Red , Green , Blue , Alpha ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern COLOR_U8 dx_GetColorU8( int Red , int Green , int Blue , int Alpha ) ;


		/// <summary> ３原色値から現在の画面モードに対応した色データ値を得る </summary>
		public static int GetColor( int Red , int Green , int Blue )
		{
			lock( locker )
			{
				int result = dx_GetColor( Red , Green , Blue ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetColor( int Red , int Green , int Blue ) ;


		/// <summary> 画面モードに対応した色データ値から個々の３原色データを抜き出す </summary>
		public static void GetColor2( int Color , out int Red , out int Green , out int Blue )
		{
			lock( locker )
			{
				int result = dx_GetColor2( Color , out Red , out Green , out Blue ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetColor2( int Color , out int Red , out int Green , out int Blue ) ;


		/// <summary> ３原色値から指定のピクセルフォーマットに対応した色データ値を得る </summary>
		public static int GetColor3( COLORDATA ColorData , int Red , int Green , int Blue )
		{
			return GetColor3( ColorData , Red , Green , Blue , 255 ) ;
		}

		/// <summary> ３原色値から指定のピクセルフォーマットに対応した色データ値を得る </summary>
		public static int GetColor3( COLORDATA ColorData , int Red , int Green , int Blue , int Alpha )
		{
			lock( locker )
			{
				int result = dx_GetColor3( ref ColorData , Red , Green , Blue , Alpha ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetColor3( [ In ] ref COLORDATA ColorData , int Red , int Green , int Blue , int Alpha ) ;


		/// <summary> ２つのカラーフォーマット間のデータ変換を行った情報を得る  </summary>
		public static int GetColor4( COLORDATA DestColorData , COLORDATA SrcColorData , int SrcColor )
		{
			lock( locker )
			{
				int result = dx_GetColor4( ref DestColorData , ref SrcColorData , SrcColor ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetColor4( [ In ] ref COLORDATA DestColorData , [ In ] ref COLORDATA SrcColorData , int SrcColor ) ;


		/// <summary> 指定カラーフォーマットに対応した色データ値から個々の３原色データを抜き出す </summary>
		public static void GetColor5( COLORDATA ColorData , int Color , out int Red , out int Green , out int Blue )
		{
			int Alpha ;
			GetColor5( ColorData , Color , out Red , out Green , out Blue , out Alpha ) ;
		}

		/// <summary> 指定カラーフォーマットに対応した色データ値から個々の３原色データを抜き出す </summary>
		public static void GetColor5( COLORDATA ColorData , int Color , out int Red , out int Green , out int Blue , out int Alpha )
		{
			lock( locker )
			{
				int result = dx_GetColor5( ref ColorData , Color , out Red , out Green , out Blue , out Alpha ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetColor5( [ In ] ref COLORDATA ColorData , int Color , out int Red , out int Green , out int Blue , out int Alpha ) ;


		/// <summary> パレットカラーのカラー情報を構築する </summary>
		public static void CreatePaletteColorData( out COLORDATA ColorDataBuf )
		{
			lock( locker )
			{
				int result = dx_CreatePaletteColorData( out ColorDataBuf ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreatePaletteColorData( out COLORDATA ColorDataBuf ) ;


		/// <summary> ＸＲＧＢ８カラーのカラー情報を構築する </summary>
		public static void CreateXRGB8ColorData( out COLORDATA ColorDataBuf )
		{
			lock( locker )
			{
				int result = dx_CreateXRGB8ColorData( out ColorDataBuf ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateXRGB8ColorData( out COLORDATA ColorDataBuf ) ;


		/// <summary> ＡＲＧＢ８カラーのカラー情報を構築する </summary>
		public static void CreateARGB8ColorData( out COLORDATA ColorDataBuf )
		{
			lock( locker )
			{
				int result = dx_CreateARGB8ColorData( out ColorDataBuf ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateARGB8ColorData( out COLORDATA ColorDataBuf ) ;


		/// <summary> フルカラーＤＩＢのカラー情報を構築する </summary>
		public static void CreateFullColorData( out COLORDATA ColorDataBuf )
		{
			lock( locker )
			{
				int result = dx_CreateFullColorData( out ColorDataBuf ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateFullColorData( out COLORDATA ColorDataBuf ) ;


		/// <summary> グレースケールのカラー情報を構築する </summary>
		public static void CreateGrayColorData( out COLORDATA ColorDataBuf )
		{
			lock( locker )
			{
				int result = dx_CreateGrayColorData( out ColorDataBuf ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateGrayColorData( out COLORDATA ColorDataBuf ) ;


		/// <summary> パレット２５６色のカラー情報を構築する </summary>
		public static void CreatePal8ColorData( out COLORDATA ColorDataBuf )
		{
			lock( locker )
			{
				int result = dx_CreatePal8ColorData( out ColorDataBuf ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreatePal8ColorData( out COLORDATA ColorDataBuf ) ;


		/// <summary> カラーデータを作成する </summary>
		public static void CreateColorData( out COLORDATA ColorDataBuf , int ColorBitDepth , int RedMask , int GreenMask , int BlueMask , int AlphaMask )
		{
			lock( locker )
			{
				int result = dx_CreateColorData( out ColorDataBuf , ColorBitDepth , RedMask , GreenMask , BlueMask , AlphaMask ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CreateColorData( out COLORDATA ColorDataBuf , int ColorBitDepth , int RedMask , int GreenMask , int BlueMask , int AlphaMask ) ;


		/// <summary> NoneMask 以外の要素を埋めた COLORDATA 構造体の情報を元に NoneMask をセットする </summary>
		public static void SetColorDataNoneMask( ref COLORDATA ColorData )
		{
			lock( locker )
			{
				dx_SetColorDataNoneMask( ref ColorData ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern void dx_SetColorDataNoneMask( [ In , Out ] ref COLORDATA ColorData ) ;


		/// <summary> 二つのカラーデータが等しいかどうか調べる( TRUE:等しい  FALSE:等しくない ) </summary>
		public static bool CmpColorData( COLORDATA ColorData1 , COLORDATA ColorData2 )
		{
			lock( locker )
			{
				int result = dx_CmpColorData( ref ColorData1 , ref ColorData2 ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CmpColorData( [ In ] ref COLORDATA ColorData1 , [ In ] ref COLORDATA ColorData2 ) ;
	}
}
