This commit is contained in:
2012-09-02 15:24:38 +02:00
commit 5b667b5781
250 changed files with 70477 additions and 0 deletions

View File

@@ -0,0 +1,205 @@
namespace Sample04
{
partial class MainForm
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.ofd = new System.Windows.Forms.OpenFileDialog();
this.bOpenFile = new System.Windows.Forms.Button();
this.lWidth = new System.Windows.Forms.Label();
this.lHeight = new System.Windows.Forms.Label();
this.lBPP = new System.Windows.Forms.Label();
this.lRedMask = new System.Windows.Forms.Label();
this.lGreenMask = new System.Windows.Forms.Label();
this.lBlueMask = new System.Windows.Forms.Label();
this.lImageType = new System.Windows.Forms.Label();
this.lDPIY = new System.Windows.Forms.Label();
this.lDPIX = new System.Windows.Forms.Label();
this.lFormat = new System.Windows.Forms.Label();
this.lHeader = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// ofd
//
this.ofd.Filter = "All files (*.*)|*.*";
//
// bOpenFile
//
this.bOpenFile.Location = new System.Drawing.Point(12, 358);
this.bOpenFile.Name = "bOpenFile";
this.bOpenFile.Size = new System.Drawing.Size(75, 23);
this.bOpenFile.TabIndex = 4;
this.bOpenFile.Text = "Open file";
this.bOpenFile.UseVisualStyleBackColor = true;
this.bOpenFile.Click += new System.EventHandler(this.bOpenFile_Click);
//
// lWidth
//
this.lWidth.AutoSize = true;
this.lWidth.Location = new System.Drawing.Point(9, 51);
this.lWidth.Name = "lWidth";
this.lWidth.Size = new System.Drawing.Size(46, 16);
this.lWidth.TabIndex = 0;
this.lWidth.Text = "Width:";
//
// lHeight
//
this.lHeight.AutoSize = true;
this.lHeight.Location = new System.Drawing.Point(9, 76);
this.lHeight.Name = "lHeight";
this.lHeight.Size = new System.Drawing.Size(53, 16);
this.lHeight.TabIndex = 1;
this.lHeight.Text = "Height: ";
//
// lBPP
//
this.lBPP.AutoSize = true;
this.lBPP.Location = new System.Drawing.Point(9, 101);
this.lBPP.Name = "lBPP";
this.lBPP.Size = new System.Drawing.Size(80, 16);
this.lBPP.TabIndex = 2;
this.lBPP.Text = "Color Depth:";
//
// lRedMask
//
this.lRedMask.AutoSize = true;
this.lRedMask.Location = new System.Drawing.Point(9, 129);
this.lRedMask.Name = "lRedMask";
this.lRedMask.Size = new System.Drawing.Size(68, 16);
this.lRedMask.TabIndex = 3;
this.lRedMask.Text = "Red Mask:";
//
// lGreenMask
//
this.lGreenMask.AutoSize = true;
this.lGreenMask.Location = new System.Drawing.Point(9, 188);
this.lGreenMask.Name = "lGreenMask";
this.lGreenMask.Size = new System.Drawing.Size(80, 16);
this.lGreenMask.TabIndex = 5;
this.lGreenMask.Text = "Green Mask:";
//
// lBlueMask
//
this.lBlueMask.AutoSize = true;
this.lBlueMask.Location = new System.Drawing.Point(9, 158);
this.lBlueMask.Name = "lBlueMask";
this.lBlueMask.Size = new System.Drawing.Size(70, 16);
this.lBlueMask.TabIndex = 6;
this.lBlueMask.Text = "Blue Mask:";
//
// lImageType
//
this.lImageType.AutoSize = true;
this.lImageType.Location = new System.Drawing.Point(9, 215);
this.lImageType.Name = "lImageType";
this.lImageType.Size = new System.Drawing.Size(81, 16);
this.lImageType.TabIndex = 7;
this.lImageType.Text = "Image Type:";
//
// lDPIY
//
this.lDPIY.AutoSize = true;
this.lDPIY.Location = new System.Drawing.Point(9, 244);
this.lDPIY.Name = "lDPIY";
this.lDPIY.Size = new System.Drawing.Size(43, 16);
this.lDPIY.TabIndex = 8;
this.lDPIY.Text = "DPI Y:";
//
// lDPIX
//
this.lDPIX.AutoSize = true;
this.lDPIX.Location = new System.Drawing.Point(9, 273);
this.lDPIX.Name = "lDPIX";
this.lDPIX.Size = new System.Drawing.Size(44, 16);
this.lDPIX.TabIndex = 9;
this.lDPIX.Text = "DPI X:";
//
// lFormat
//
this.lFormat.AutoSize = true;
this.lFormat.Location = new System.Drawing.Point(9, 302);
this.lFormat.Name = "lFormat";
this.lFormat.Size = new System.Drawing.Size(78, 16);
this.lFormat.TabIndex = 10;
this.lFormat.Text = "File Format:";
//
// lHeader
//
this.lHeader.AutoSize = true;
this.lHeader.Location = new System.Drawing.Point(117, 19);
this.lHeader.Name = "lHeader";
this.lHeader.Size = new System.Drawing.Size(162, 16);
this.lHeader.TabIndex = 11;
this.lHeader.Text = "Bitmap-Information Viewer";
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(400, 393);
this.Controls.Add(this.lHeader);
this.Controls.Add(this.lFormat);
this.Controls.Add(this.lDPIX);
this.Controls.Add(this.lDPIY);
this.Controls.Add(this.lImageType);
this.Controls.Add(this.lBlueMask);
this.Controls.Add(this.lGreenMask);
this.Controls.Add(this.bOpenFile);
this.Controls.Add(this.lRedMask);
this.Controls.Add(this.lBPP);
this.Controls.Add(this.lHeight);
this.Controls.Add(this.lWidth);
this.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Sample04";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.OpenFileDialog ofd;
private System.Windows.Forms.Button bOpenFile;
private System.Windows.Forms.Label lWidth;
private System.Windows.Forms.Label lHeight;
private System.Windows.Forms.Label lBPP;
private System.Windows.Forms.Label lRedMask;
private System.Windows.Forms.Label lGreenMask;
private System.Windows.Forms.Label lBlueMask;
private System.Windows.Forms.Label lImageType;
private System.Windows.Forms.Label lDPIY;
private System.Windows.Forms.Label lDPIX;
private System.Windows.Forms.Label lFormat;
private System.Windows.Forms.Label lHeader;
}
}

View File

@@ -0,0 +1,120 @@
using System;
using System.Windows.Forms;
using FreeImageAPI;
namespace Sample04
{
public partial class MainForm : Form
{
string message = null;
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
public MainForm()
{
InitializeComponent();
FreeImageEngine.Message += new OutputMessageFunction(FreeImage_Message);
}
~MainForm()
{
FreeImageEngine.Message -= new OutputMessageFunction(FreeImage_Message);
}
void FreeImage_Message(FREE_IMAGE_FORMAT fif, string message)
{
if (this.message == null)
{
this.message = message;
}
else
{
this.message += "\n" + message;
}
}
private void bOpenFile_Click(object sender, EventArgs e)
{
// Resetting filename
ofd.FileName = "";
// Was a file selected
if (ofd.ShowDialog() == DialogResult.OK)
{
// Format is stored in 'format' on successfull load.
FREE_IMAGE_FORMAT format = FREE_IMAGE_FORMAT.FIF_UNKNOWN;
// Try loading the file
FIBITMAP dib = FreeImage.LoadEx(ofd.FileName, ref format);
try
{
// Error handling
if (dib.IsNull)
{
// Chech whether FreeImage generated an error messe
if (message != null)
{
MessageBox.Show("File could not be loaded!\nError:{0}", message);
}
else
{
MessageBox.Show("File could not be loaded!", message);
}
return;
}
// Read width
lWidth.Text = String.Format("Width: {0}", FreeImage.GetWidth(dib));
// Read height
lHeight.Text = String.Format("Width: {0}", FreeImage.GetWidth(dib));
// Read color depth
lBPP.Text = String.Format("Color Depth: {0}", FreeImage.GetBPP(dib));
// Read red bitmask (16 - 32 bpp)
lRedMask.Text = String.Format("Red Mask: 0x{0:X8}", FreeImage.GetRedMask(dib));
// Read green bitmask (16 - 32 bpp)
lBlueMask.Text = String.Format("Green Mask: 0x{0:X8}", FreeImage.GetGreenMask(dib));
// Read blue bitmask (16 - 32 bpp)
lGreenMask.Text = String.Format("Blue Mask: 0x{0:X8}", FreeImage.GetBlueMask(dib));
// Read image type (FI_BITMAP, FIT_RGB16, FIT_COMPLEX ect)
lImageType.Text = String.Format("Image Type: {0}", FreeImage.GetImageType(dib));
// Read x-axis dpi
lDPIX.Text = String.Format("DPI X: {0}", FreeImage.GetResolutionX(dib));
// Read y-axis dpi
lDPIY.Text = String.Format("DPI Y: {0}", FreeImage.GetResolutionY(dib));
// Read file format
lFormat.Text = String.Format("File Format: {0}", FreeImage.GetFormatFromFIF(format));
}
catch
{
}
// Always unload bitmap
FreeImage.UnloadEx(ref dib);
// Reset the error massage buffer
message = null;
}
// No file was selected
else
{
MessageBox.Show("No file loaded.", "Error");
}
}
}
}

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="ofd.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,16 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("7c8fdc9a-a8f9-4996-99c8-9df47513edeb")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,102 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1F4BCDD7-5BD9-4237-8B14-C52B2A9FF52A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sample04</RootNamespace>
<AssemblyName>Sample04</AssemblyName>
</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>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>
</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>
</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="FreeImageNET, Version=3.11.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\FreeImageNET.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MainForm.resx">
<SubType>Designer</SubType>
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
</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>
-->
</Project>