git-svn-id: http://svn.sourceforge.jp/svnroot/lipsync@6 b1f601f4-4f45-0410-8980-aecacb008692

This commit is contained in:
kbinani
2009-06-25 14:16:22 +00:00
parent 775d25e7fa
commit 90d1578878
373 changed files with 111302 additions and 0 deletions

View File

@@ -0,0 +1,239 @@
namespace Background {
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using Plugin;
public class Background : IPlugin {
public void ApplyLanguage( string language_code ) {
}
/// <summary>
/// <20>v<EFBFBD><76><EFBFBD>O<EFBFBD>C<EFBFBD><43><EFBFBD>̖<EFBFBD><CC96><EFBFBD>
/// </summary>
public string Name {
get {
return "Background";
}
}
/// <summary>
/// <20>v<EFBFBD><76><EFBFBD>O<EFBFBD>C<EFBFBD><43><EFBFBD>̃^<5E>C<EFBFBD>v<EFBFBD><76><EFBFBD>\<5C><><EFBFBD>B
/// </summary>
public ulong Type {
get {
return Constants.LS_ENABLES_ENTRY_SETTING + Constants.LS_NO_EVENT_HANDLER;
}
}
/// <summary>
/// <20>v<EFBFBD><76><EFBFBD>O<EFBFBD>C<EFBFBD><43><EFBFBD>̊Ȍ<CC8A><C88C>Ȑ<EFBFBD><C890><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
/// </summary>
public string Abstract {
get {
return "<22><EFBFBD><E6919C><EFBFBD>z<EFBFBD>u<EFBFBD><75><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD><76><EFBFBD>O<EFBFBD>C<EFBFBD><43><EFBFBD>ł<EFBFBD><C582>B<EFBFBD>l<EFBFBD>X<EFBFBD>ȓ<EFBFBD><C893><EFBFBD><EFBFBD><EFBFBD><EFBFBD>g<EFBFBD><67><EFBFBD>܂<EFBFBD><DC82>B";
}
}
/// <summary>
/// <20>C<EFBFBD>x<EFBFBD><78><EFBFBD>g<EFBFBD>n<EFBFBD><6E><EFBFBD>h<EFBFBD><68><EFBFBD>B<EFBFBD><42><EFBFBD>̃v<CC83><76><EFBFBD>O<EFBFBD>C<EFBFBD><43><EFBFBD>̐ݒ胁<DD92>j<EFBFBD><6A><EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EA82BD><EFBFBD>Ăяo<D18F><6F><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public DialogResult BaseSetting() {
return DialogResult.Cancel;
}
public DialogResult EntrySetting( ref string config ) {
EntryConfig cfg = new EntryConfig( config );
DialogResult result;
using ( entry_config dlg = new entry_config( cfg ) ) {
result = dlg.ShowDialog();
if ( result == DialogResult.OK ) {
cfg = dlg.Config;
config = cfg.ToString();
}
}
return result;
}
/// <summary>
/// <20>ݒ<EFBFBD><DD92>l<EFBFBD><6C><EFBFBD>i<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>w<EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
/// </summary>
/// <returns></returns>
public string Config {
get {
return "";
}
set {
}
}
private Bitmap m_bmp;
private string m_last_file = "";
/// <summary>
/// <20>t<EFBFBD><74><EFBFBD>[<5B><><EFBFBD>ɉ<EFBFBD><C989>H<EFBFBD><48><EFBFBD>{<7B><><EFBFBD>֐<EFBFBD>
/// </summary>
/// <param name="bmp"></param>
/// <param name="time"></param>
public void Apply( ref Bitmap bmp, float time, float e_begin, float e_end, ref string e_body ) {
EntryConfig cfg = new EntryConfig( e_body );
if ( m_last_file != "" ) {
if ( m_last_file != cfg.File ) {
Image img = ImageFromFile( cfg.File );
if ( img != null ) {
m_bmp = new Bitmap( img.Width, img.Height, PixelFormat.Format32bppArgb );
using ( Graphics gx = Graphics.FromImage( m_bmp ) ) {
gx.DrawImage( img, 0, 0, img.Width, img.Height );
}
}
m_last_file = cfg.File;
}
} else {
Image img = ImageFromFile( cfg.File );
if ( img != null ) {
m_bmp = new Bitmap( img.Width, img.Height, PixelFormat.Format32bppArgb );
using ( Graphics gx = Graphics.FromImage( m_bmp ) ) {
gx.DrawImage( img, 0, 0, img.Width, img.Height );
}
}
}
float alpha = 1f;
if ( cfg.FadeIn ) {
float diff = time - e_begin;
if ( 0f <= diff && diff <= cfg.FadeInRatio ) {
alpha = 1.0f / cfg.FadeInRatio * diff;
}
}
if ( cfg.FadeOut ) {
float diff = e_end - time;
if ( 0f <= diff && diff <= cfg.FadeOutRatio ) {
alpha = 1.0f / cfg.FadeOutRatio * diff;
}
}
if ( m_bmp != null ) {
using ( Graphics g = Graphics.FromImage( bmp ) ) {
//g.DrawImage( m_bmp, cfg.X, cfg.Y, m_bmp.Width * cfg.Scale, m_bmp.Height * cfg.Scale );
ColorMatrix cm = new ColorMatrix();
cm.Matrix00 = 1;
cm.Matrix11 = 1;
cm.Matrix22 = 1;
cm.Matrix33 = alpha;
cm.Matrix44 = 1;
ImageAttributes ia = new ImageAttributes();
ia.SetColorMatrix( cm );
int width = (int)(m_bmp.Width * cfg.Scale);
int height = (int)(m_bmp.Height * cfg.Scale);
int iwidth = m_bmp.Width;
int iheight = m_bmp.Height;
g.DrawImage( m_bmp, new Rectangle( cfg.X, cfg.Y, width, height ),
0, 0, iwidth, iheight, GraphicsUnit.Pixel, ia );
}
}
}
/// <summary>
/// <20>w<EFBFBD><EFBFBD><E882B5><EFBFBD>p<EFBFBD>X<EFBFBD>̃t<CC83>@<40>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>C<EFBFBD><43><EFBFBD>[<5B>W<EFBFBD><57><EFBFBD>ǂݍ<C782><DD8D>݂܂<DD82>
/// </summary>
/// <param name="fpath"></param>
/// <returns></returns>
public static Image ImageFromFile( string fpath ) {
Image result = null;
if ( File.Exists( fpath ) ) {
using ( FileStream fs = new FileStream( fpath, FileMode.Open, FileAccess.Read ) ) {
result = Image.FromStream( fs );
}
}
return result;
}
public void Render( Graphics g, Size size, float time, string mouth, string reserved ) {
}
}
public struct EntryConfig {
public string File;
public bool FadeIn;
public bool FadeOut;
public int X;
public int Y;
public float Scale;
public float FadeInRatio;
public float FadeOutRatio;
public EntryConfig( string config ) {
string[] spl = config.Split( new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries );
File = "";
FadeIn = false;
FadeOut = false;
X = 0;
Y = 0;
Scale = 1f;
FadeInRatio = 2f;
FadeOutRatio = 2f;
foreach ( string entry in spl ) {
string[] spl2 = entry.Split( new char[] { '=' } );
switch ( spl2[0] ) {
case "File":
File = spl2[1];
break;
case "FadeIn":
if ( spl2[1] == TRUE ) {
FadeIn = true;
} else {
FadeIn = false;
}
break;
case "FadeOut":
if ( spl2[1] == TRUE ) {
FadeOut = true;
} else {
FadeOut = false;
}
break;
case "X":
X = int.Parse( spl2[1] );
break;
case "Y":
Y = int.Parse( spl2[1] );
break;
case "Scale":
Scale = float.Parse( spl2[1] );
break;
case "FadeInRatio":
FadeInRatio = float.Parse( spl2[1] );
break;
case "FadeOutRatio":
FadeOutRatio = float.Parse( spl2[1] );
break;
}
}
}
private const string TRUE = "true";
private const string FALSE = "false";
new public string ToString() {
string fadein, fadeout;
if ( FadeIn ) {
fadein = TRUE;
} else {
fadein = FALSE;
}
if ( FadeOut ) {
fadeout = TRUE;
} else {
fadeout = FALSE;
}
return "File=" + File + "\nFadeIn=" + fadein + "\nFadeOut=" + fadeout + "\nX=" + X + "\nY=" + Y + "\nScale=" + Scale + "\nFadeInRatio=" + FadeInRatio + "\nFadeOutRatio=" + FadeOutRatio;
}
}
}

View File

@@ -0,0 +1,77 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F3B0AB64-CEEE-4003-9DA1-BCD4109ECBA9}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Background</RootNamespace>
<AssemblyName>Background</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>2.0</OldToolsVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Background.cs" />
<Compile Include="entry_config.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="entry_config.Designer.cs">
<DependentUpon>entry_config.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="entry_config.resx">
<SubType>Designer</SubType>
<DependentUpon>entry_config.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IPlugin\IPlugin.csproj">
<Project>{FB0C1FBD-3CB7-46BF-8E39-57BE2C8D1F00}</Project>
<Name>IPlugin</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle( "Background" )]
[assembly: AssemblyDescription( "" )]
[assembly: AssemblyConfiguration( "" )]
[assembly: AssemblyCompany( "Boare" )]
[assembly: AssemblyProduct( "Background" )]
[assembly: AssemblyCopyright( "Copyright (C) 2008" )]
[assembly: AssemblyTrademark( "" )]
[assembly: AssemblyCulture( "" )]
// ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントには
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible( false )]
// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です
[assembly: Guid( "8c648f56-5cc7-432d-a8a5-73ed17b699b1" )]
// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// すべての値を指定するか、下のように '*' を使ってリビジョンおよびビルド番号を
// 既定値にすることができます:
[assembly: AssemblyVersion( "1.0.0.0" )]
[assembly: AssemblyFileVersion( "1.0.0.0" )]

View File

@@ -0,0 +1,289 @@
namespace Background {
partial class entry_config {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
private void InitializeComponent() {
this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.txtFile = new System.Windows.Forms.TextBox();
this.btnFile = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.txtX = new System.Windows.Forms.TextBox();
this.txtY = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.dialogImage = new System.Windows.Forms.OpenFileDialog();
this.label4 = new System.Windows.Forms.Label();
this.txtScale = new System.Windows.Forms.TextBox();
this.chkFadeIn = new System.Windows.Forms.CheckBox();
this.chkFadeOut = new System.Windows.Forms.CheckBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtFadeOutRatio = new System.Windows.Forms.TextBox();
this.txtFadeInRatio = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point( 280, 238 );
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size( 75, 23 );
this.btnCancel.TabIndex = 21;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point( 181, 238 );
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size( 75, 23 );
this.btnOK.TabIndex = 20;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler( this.btnOK_Click );
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point( 12, 15 );
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size( 63, 12 );
this.label1.TabIndex = 22;
this.label1.Text = "画像ファイル";
//
// txtFile
//
this.txtFile.Location = new System.Drawing.Point( 81, 12 );
this.txtFile.Name = "txtFile";
this.txtFile.Size = new System.Drawing.Size( 244, 19 );
this.txtFile.TabIndex = 23;
//
// btnFile
//
this.btnFile.Location = new System.Drawing.Point( 331, 10 );
this.btnFile.Name = "btnFile";
this.btnFile.Size = new System.Drawing.Size( 24, 23 );
this.btnFile.TabIndex = 24;
this.btnFile.Text = "...";
this.btnFile.UseVisualStyleBackColor = true;
this.btnFile.Click += new System.EventHandler( this.btnFile_Click );
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point( 12, 24 );
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size( 12, 12 );
this.label2.TabIndex = 25;
this.label2.Text = "X";
//
// txtX
//
this.txtX.Location = new System.Drawing.Point( 30, 21 );
this.txtX.Name = "txtX";
this.txtX.Size = new System.Drawing.Size( 100, 19 );
this.txtX.TabIndex = 26;
this.txtX.Text = "0";
//
// txtY
//
this.txtY.Location = new System.Drawing.Point( 213, 21 );
this.txtY.Name = "txtY";
this.txtY.Size = new System.Drawing.Size( 100, 19 );
this.txtY.TabIndex = 28;
this.txtY.Text = "0";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point( 195, 24 );
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size( 12, 12 );
this.label3.TabIndex = 27;
this.label3.Text = "Y";
//
// dialogImage
//
this.dialogImage.Filter = "Image Files|*.bmp;*.png;*.jpg|All Files|*.*";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point( 12, 60 );
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size( 53, 12 );
this.label4.TabIndex = 29;
this.label4.Text = "表示倍率";
//
// txtScale
//
this.txtScale.Location = new System.Drawing.Point( 71, 57 );
this.txtScale.Name = "txtScale";
this.txtScale.Size = new System.Drawing.Size( 100, 19 );
this.txtScale.TabIndex = 30;
this.txtScale.Text = "1.0";
//
// chkFadeIn
//
this.chkFadeIn.AutoSize = true;
this.chkFadeIn.Location = new System.Drawing.Point( 18, 24 );
this.chkFadeIn.Name = "chkFadeIn";
this.chkFadeIn.Size = new System.Drawing.Size( 76, 16 );
this.chkFadeIn.TabIndex = 31;
this.chkFadeIn.Text = "フェードイン";
this.chkFadeIn.UseVisualStyleBackColor = true;
this.chkFadeIn.CheckedChanged += new System.EventHandler( this.chkFadeIn_CheckedChanged );
//
// chkFadeOut
//
this.chkFadeOut.AutoSize = true;
this.chkFadeOut.Location = new System.Drawing.Point( 18, 59 );
this.chkFadeOut.Name = "chkFadeOut";
this.chkFadeOut.Size = new System.Drawing.Size( 84, 16 );
this.chkFadeOut.TabIndex = 32;
this.chkFadeOut.Text = "フェードアウト";
this.chkFadeOut.UseVisualStyleBackColor = true;
this.chkFadeOut.CheckedChanged += new System.EventHandler( this.chkFadeOut_CheckedChanged );
//
// groupBox1
//
this.groupBox1.Controls.Add( this.txtFadeOutRatio );
this.groupBox1.Controls.Add( this.txtFadeInRatio );
this.groupBox1.Controls.Add( this.label6 );
this.groupBox1.Controls.Add( this.label5 );
this.groupBox1.Controls.Add( this.chkFadeIn );
this.groupBox1.Controls.Add( this.chkFadeOut );
this.groupBox1.Location = new System.Drawing.Point( 12, 136 );
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size( 343, 90 );
this.groupBox1.TabIndex = 33;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Fade IN/OUT";
//
// txtFadeOutRatio
//
this.txtFadeOutRatio.Enabled = false;
this.txtFadeOutRatio.Location = new System.Drawing.Point( 227, 57 );
this.txtFadeOutRatio.Name = "txtFadeOutRatio";
this.txtFadeOutRatio.Size = new System.Drawing.Size( 103, 19 );
this.txtFadeOutRatio.TabIndex = 36;
//
// txtFadeInRatio
//
this.txtFadeInRatio.Enabled = false;
this.txtFadeInRatio.Location = new System.Drawing.Point( 227, 22 );
this.txtFadeInRatio.Name = "txtFadeInRatio";
this.txtFadeInRatio.Size = new System.Drawing.Size( 103, 19 );
this.txtFadeInRatio.TabIndex = 35;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point( 138, 60 );
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size( 83, 12 );
this.label6.TabIndex = 34;
this.label6.Text = "効果時間(秒):";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point( 138, 25 );
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size( 83, 12 );
this.label5.TabIndex = 33;
this.label5.Text = "効果時間(秒):";
//
// groupBox2
//
this.groupBox2.Controls.Add( this.txtScale );
this.groupBox2.Controls.Add( this.label4 );
this.groupBox2.Controls.Add( this.txtX );
this.groupBox2.Controls.Add( this.label2 );
this.groupBox2.Controls.Add( this.txtY );
this.groupBox2.Controls.Add( this.label3 );
this.groupBox2.Location = new System.Drawing.Point( 12, 37 );
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size( 343, 93 );
this.groupBox2.TabIndex = 34;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Position and Scale";
//
// entry_config
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F );
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size( 369, 273 );
this.Controls.Add( this.groupBox2 );
this.Controls.Add( this.groupBox1 );
this.Controls.Add( this.btnFile );
this.Controls.Add( this.txtFile );
this.Controls.Add( this.label1 );
this.Controls.Add( this.btnCancel );
this.Controls.Add( this.btnOK );
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "entry_config";
this.ShowInTaskbar = false;
this.Text = "EntryConfig";
this.groupBox1.ResumeLayout( false );
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout( false );
this.groupBox2.PerformLayout();
this.ResumeLayout( false );
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtFile;
private System.Windows.Forms.Button btnFile;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtX;
private System.Windows.Forms.TextBox txtY;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.OpenFileDialog dialogImage;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtScale;
private System.Windows.Forms.CheckBox chkFadeIn;
private System.Windows.Forms.CheckBox chkFadeOut;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txtFadeOutRatio;
private System.Windows.Forms.TextBox txtFadeInRatio;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.GroupBox groupBox2;
}
}

View File

@@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Background {
public partial class entry_config : Form {
EntryConfig m_entry_config;
public entry_config( EntryConfig config ) {
InitializeComponent();
m_entry_config = config;
txtFile.Text = m_entry_config.File;
txtX.Text = m_entry_config.X.ToString();
txtY.Text = m_entry_config.Y.ToString();
txtScale.Text = m_entry_config.Scale.ToString();
chkFadeIn.Checked = m_entry_config.FadeIn;
chkFadeOut.Checked = m_entry_config.FadeOut;
txtFadeInRatio.Text = m_entry_config.FadeInRatio.ToString();
txtFadeOutRatio.Text = m_entry_config.FadeOutRatio.ToString();
}
private void btnFile_Click( object sender, EventArgs e ) {
if ( dialogImage.ShowDialog() == DialogResult.OK ) {
txtFile.Text = dialogImage.FileName;
}
}
private void btnOK_Click( object sender, EventArgs e ) {
EntryConfig old = m_entry_config;
try {
m_entry_config.File = txtFile.Text;
m_entry_config.X = int.Parse( txtX.Text );
m_entry_config.Y = int.Parse( txtY.Text );
m_entry_config.Scale = float.Parse( txtScale.Text );
m_entry_config.FadeIn = chkFadeIn.Checked;
m_entry_config.FadeOut = chkFadeOut.Checked;
m_entry_config.FadeInRatio = float.Parse( txtFadeInRatio.Text );
m_entry_config.FadeOutRatio = float.Parse( txtFadeOutRatio.Text );
if ( m_entry_config.FadeInRatio <= 0f ) {
m_entry_config.FadeIn = false;
m_entry_config.FadeInRatio = 2f;
}
if ( m_entry_config.FadeOutRatio <= 0f ) {
m_entry_config.FadeOut = false;
m_entry_config.FadeOutRatio = 2f;
}
this.DialogResult = DialogResult.OK;
} catch {
m_entry_config = old;
this.DialogResult = DialogResult.Cancel;
}
}
public EntryConfig Config {
get {
return m_entry_config;
}
}
private void chkFadeIn_CheckedChanged( object sender, EventArgs e ) {
txtFadeInRatio.Enabled = chkFadeIn.Checked;
}
private void chkFadeOut_CheckedChanged( object sender, EventArgs e ) {
txtFadeOutRatio.Enabled = chkFadeOut.Checked;
}
}
}

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="dialogImage.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,10 @@
RM=rm
CP=cp
Background.dll: Background.cs entry_config.cs entry_config.Designer.cs IPlugin.dll
gmcs -target:library -out:Background.dll \
-r:System.Windows.Forms,System.Drawing,IPlugin.dll \
Background.cs entry_config.cs entry_config.Designer.cs
clean:
$(RM) Background.dll IPlugin.dll