@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
lib/ |
||||
ImageDraw/ |
||||
packages/ |
||||
ipch/ |
||||
*.zip |
||||
*.pdf |
||||
*.rar |
||||
*.txt |
||||
*.pdb |
||||
obj/ |
||||
Debug/ |
||||
*.html |
||||
*.*~ |
||||
*.suo |
||||
*.sdf |
||||
.vs/ |
||||
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 7.0 MiB |
|
After Width: | Height: | Size: 22 MiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 311 B |
|
After Width: | Height: | Size: 507 B |
|
After Width: | Height: | Size: 465 B |
|
After Width: | Height: | Size: 332 B |
@ -0,0 +1,99 @@
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup Label="ProjectConfigurations"> |
||||
<ProjectConfiguration Include="Debug|Win32"> |
||||
<Configuration>Debug</Configuration> |
||||
<Platform>Win32</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Release|Win32"> |
||||
<Configuration>Release</Configuration> |
||||
<Platform>Win32</Platform> |
||||
</ProjectConfiguration> |
||||
</ItemGroup> |
||||
<PropertyGroup Label="Globals"> |
||||
<ProjectGuid>{F7F6C86C-4770-450C-A162-194389C17D2D}</ProjectGuid> |
||||
<Keyword>Win32Proj</Keyword> |
||||
<RootNamespace>ConsoleApplication1</RootNamespace> |
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> |
||||
</PropertyGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
||||
<ConfigurationType>Application</ConfigurationType> |
||||
<UseDebugLibraries>true</UseDebugLibraries> |
||||
<PlatformToolset>v142</PlatformToolset> |
||||
<CharacterSet>Unicode</CharacterSet> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
||||
<ConfigurationType>Application</ConfigurationType> |
||||
<UseDebugLibraries>false</UseDebugLibraries> |
||||
<PlatformToolset>v142</PlatformToolset> |
||||
<WholeProgramOptimization>true</WholeProgramOptimization> |
||||
<CharacterSet>Unicode</CharacterSet> |
||||
</PropertyGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
||||
<ImportGroup Label="ExtensionSettings"> |
||||
</ImportGroup> |
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
||||
</ImportGroup> |
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
||||
</ImportGroup> |
||||
<PropertyGroup Label="UserMacros" /> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
||||
<LinkIncremental>true</LinkIncremental> |
||||
<OutDir>.\Debug</OutDir> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
||||
<LinkIncremental>false</LinkIncremental> |
||||
<OutDir>.\Release</OutDir> |
||||
</PropertyGroup> |
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
||||
<ClCompile> |
||||
<PrecompiledHeader>Use</PrecompiledHeader> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<Optimization>Disabled</Optimization> |
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<LanguageStandard>stdcpp17</LanguageStandard> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Console</SubSystem> |
||||
<GenerateDebugInformation>true</GenerateDebugInformation> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
||||
<ClCompile> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<PrecompiledHeader>Use</PrecompiledHeader> |
||||
<Optimization>MaxSpeed</Optimization> |
||||
<FunctionLevelLinking>true</FunctionLevelLinking> |
||||
<IntrinsicFunctions>true</IntrinsicFunctions> |
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<LanguageStandard>stdcpp17</LanguageStandard> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Console</SubSystem> |
||||
<GenerateDebugInformation>true</GenerateDebugInformation> |
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
||||
<OptimizeReferences>true</OptimizeReferences> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
<ItemGroup> |
||||
<Text Include="ReadMe.txt" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ClInclude Include="main.h" /> |
||||
<ClInclude Include="stdafx.h" /> |
||||
<ClInclude Include="targetver.h" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ClCompile Include="ConsoleApplication1.cpp" /> |
||||
<ClCompile Include="stdafx.cpp"> |
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> |
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> |
||||
</ClCompile> |
||||
</ItemGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
||||
<ImportGroup Label="ExtensionTargets"> |
||||
</ImportGroup> |
||||
</Project> |
||||
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup> |
||||
<Filter Include="Файлы исходного кода"> |
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> |
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> |
||||
</Filter> |
||||
<Filter Include="Заголовочные файлы"> |
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> |
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> |
||||
</Filter> |
||||
<Filter Include="Файлы ресурсов"> |
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> |
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> |
||||
</Filter> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Text Include="ReadMe.txt" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ClInclude Include="stdafx.h"> |
||||
<Filter>Заголовочные файлы</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="targetver.h"> |
||||
<Filter>Заголовочные файлы</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="main.h"> |
||||
<Filter>Заголовочные файлы</Filter> |
||||
</ClInclude> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ClCompile Include="stdafx.cpp"> |
||||
<Filter>Файлы исходного кода</Filter> |
||||
</ClCompile> |
||||
<ClCompile Include="ConsoleApplication1.cpp"> |
||||
<Filter>Файлы исходного кода</Filter> |
||||
</ClCompile> |
||||
</ItemGroup> |
||||
</Project> |
||||
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
||||
<LocalDebuggerCommandArguments>111.bmp 222.bmp</LocalDebuggerCommandArguments> |
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> |
||||
</PropertyGroup> |
||||
</Project> |
||||
@ -0,0 +1,174 @@
@@ -0,0 +1,174 @@
|
||||
#ifndef MAIN_H_INCLUDED |
||||
#define MAIN_H_INCLUDED |
||||
|
||||
typedef unsigned char U8; |
||||
typedef signed char S8; |
||||
typedef unsigned short U16; |
||||
typedef signed short S16; |
||||
typedef unsigned int U32; |
||||
typedef signed int S32; |
||||
typedef unsigned long long U64; |
||||
typedef signed long long S64; |
||||
typedef bool BIT; |
||||
|
||||
#define __FALSE 0 |
||||
#define __TRUE 1 |
||||
|
||||
#define BAD_PIXELS_ARRAY_SIZE 256 |
||||
#define NO_MARKER 0 // 'no marker' cluster identifier
|
||||
#define SN_LENGTH 128 |
||||
// FIFO coordinate XY-correction
|
||||
#define FIFO_X_OFFSET -11 |
||||
#define FIFO_Y_OFFSET -4 |
||||
//---------------------------------------------------------------------------
|
||||
// CMOS matrix definitions
|
||||
#define IMAGE_CX (320-1) |
||||
#define IMAGE_CY (256-1) |
||||
#define CELL_SIZE 8 // cluster cell size, in pix
|
||||
#define IMAGE_CELL_CX ((IMAGE_CX + CELL_SIZE - 1) / CELL_SIZE) |
||||
#define IMAGE_CELL_CY ((IMAGE_CY + CELL_SIZE - 1) / CELL_SIZE) |
||||
|
||||
|
||||
typedef struct |
||||
{ |
||||
U16 bfType; |
||||
U32 bfSize; |
||||
U16 bfReserved1; |
||||
U16 bfReserved2; |
||||
U32 bfOffBits; |
||||
} BFHEADER; |
||||
|
||||
typedef struct |
||||
{ |
||||
U32 biSize; |
||||
S32 biWidth; |
||||
S32 biHeight; |
||||
U16 biPlanes; |
||||
U16 biBitCount; |
||||
U32 biCompression; |
||||
U32 biSizeImage; |
||||
S32 biXPelsPerMeter; |
||||
S32 biYPelsPerMeter; |
||||
U32 biClrUsed; |
||||
U32 biClrImportant; |
||||
} BIHEADER; |
||||
|
||||
|
||||
typedef struct |
||||
{ |
||||
U8 rgbBlue; |
||||
U8 rgbGreen; |
||||
U8 rgbRed; |
||||
U8 rgbReserved; |
||||
} RGBQ; |
||||
|
||||
typedef struct |
||||
{ |
||||
float x; |
||||
float y; |
||||
} FIFO_ITEM_f; |
||||
|
||||
static unsigned short read_u16(FILE *fp); |
||||
static unsigned int read_u32(FILE *fp); |
||||
static int read_s32(FILE *fp); |
||||
|
||||
|
||||
#pragma pack(push, 1) |
||||
typedef struct |
||||
{ |
||||
unsigned short left; |
||||
unsigned short top; |
||||
unsigned short right; |
||||
unsigned short bottom; |
||||
|
||||
} ARM_RECT; |
||||
|
||||
typedef struct |
||||
{ |
||||
U16 x; |
||||
U16 y; |
||||
} FIFO_ITEM; |
||||
|
||||
typedef struct |
||||
{ |
||||
U16 count; |
||||
FIFO_ITEM array[BAD_PIXELS_ARRAY_SIZE]; |
||||
} BAD_PIX_FILE_STRUCTURE; |
||||
|
||||
typedef struct |
||||
{ |
||||
FIFO_ITEM *pi; |
||||
U8 *pm; |
||||
} THE_POINT; |
||||
|
||||
typedef struct |
||||
{ |
||||
U16 count; // number of points (pixels) in cluster
|
||||
U8 excluded; // flag, cluster should be ignored if TRUE
|
||||
U8 marker; // cluster identicator
|
||||
ARM_RECT rect; // rectangular area of cluster (in pixels)
|
||||
} CLUSTER_COORD; |
||||
|
||||
typedef struct |
||||
{ |
||||
U32 time; // time of alarm, in 10us units
|
||||
S16 angle1; //
|
||||
S16 angle2; //
|
||||
} COORDS_DATA; |
||||
|
||||
typedef struct |
||||
{ |
||||
U8 szSerialNumber[SN_LENGTH];// matrix serial number, zero-terminated string
|
||||
U16 nXc, nYc; // centers of matrices, pix
|
||||
U16 nRs, nRb; // lens field of view radius ('s'=small, 'b'=big), pix
|
||||
U8 cLc; // neighbour distance for clasters, pix
|
||||
U16 nLimit; // FIFO limit (10-bit)
|
||||
U16 nVinb, nVref; // VINB & VREF (10-bit)
|
||||
float fA, fB, fC; // Fi=A*x^2 + Bx + C
|
||||
} CONFIG_FILE_STRUCTURE; |
||||
|
||||
#pragma pack(pop) |
||||
|
||||
|
||||
#define COORDS_FIFO_SIZE 16 // maximum number of items in coordinates FIFO array
|
||||
//----------------------------------------------------------------------------
|
||||
#define ENTER_CRITICAL_SECTION() os_mut_wait(g_mutex, 0xffff) |
||||
#define LEAVE_CRITICAL_SECTION() os_mut_release(g_mutex) |
||||
//----------------------------------------------------------------------------
|
||||
// constant variables
|
||||
static const char g_badpix_filename1[] = "S:\\bad_pix1.raw"; |
||||
static const char g_badpix_filename2[] = "S:\\bad_pix2.raw"; |
||||
static const char g_config_filename1[] = "S:\\config1.raw"; |
||||
static const char g_config_filename2[] = "S:\\config2.raw"; |
||||
//----------------------------------------------------------------------------
|
||||
// common inter-task variables (access-protected by mutex)
|
||||
static U64 g_init_time_10us; |
||||
static COORDS_DATA g_coords[COORDS_FIFO_SIZE]; // coordinates FIFO array
|
||||
static U16 g_coords_index = 0; // index of 1-st free item in array
|
||||
//----------------------------------------------------------------------------
|
||||
// transmittion task CAN id
|
||||
//----------------------------------------------------------------------------
|
||||
// bad pixels & config variables
|
||||
static BAD_PIX_FILE_STRUCTURE g_bad_pixels1; // bad pixel array for CMOS1
|
||||
static BAD_PIX_FILE_STRUCTURE g_bad_pixels2; // bad pixel array for CMOS2
|
||||
static CONFIG_FILE_STRUCTURE g_config1; // config settings for CMOS1
|
||||
static CONFIG_FILE_STRUCTURE g_config2; // config settings for CMOS2
|
||||
// shot fifo & cluster variables
|
||||
static FIFO_ITEM g_shot_array1[4096]; // shot XY-coordinates from FIFO1
|
||||
static FIFO_ITEM g_shot_array2[4096]; // shot XY-coordinates from FIFO2
|
||||
static U16 g_shot_count1; // number of shot XY-coordinate pairs in FIFO1
|
||||
static U16 g_shot_count2; // number of shot XY-coordinate pairs in FIFO2
|
||||
static CLUSTER_COORD g_cluster_coords1[IMAGE_CELL_CX*IMAGE_CELL_CY]; // clusters mass centre & coordinates in FIFO1
|
||||
static CLUSTER_COORD g_cluster_coords2[IMAGE_CELL_CX*IMAGE_CELL_CY]; // clusters mass centre & coordinates in FIFO2
|
||||
static CLUSTER_COORD *g_cluster_ptrs1[IMAGE_CELL_CX*IMAGE_CELL_CY]; //
|
||||
static CLUSTER_COORD *g_cluster_ptrs2[IMAGE_CELL_CX*IMAGE_CELL_CY]; //
|
||||
static U16 g_cluster_count1; // number of clusters (8x8) in FIFO1
|
||||
static U16 g_cluster_count2; // number of clusters (8x8) in FIFO2
|
||||
static CLUSTER_COORD g_super_cluster_coords1[IMAGE_CELL_CX*IMAGE_CELL_CY]; |
||||
static CLUSTER_COORD g_super_cluster_coords2[IMAGE_CELL_CX*IMAGE_CELL_CY]; |
||||
static U16 g_super_cluster_count1; // number of super clusters in FIFO1
|
||||
static U16 g_super_cluster_count2; // number of super clusters in FIFO2
|
||||
|
||||
|
||||
|
||||
#endif // MAIN_H_INCLUDEDs
|
||||
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp: исходный файл, содержащий только стандартные включаемые модули
|
||||
// ConsoleApplication1.pch будет предкомпилированным заголовком
|
||||
// stdafx.obj будет содержать предварительно откомпилированные сведения о типе
|
||||
|
||||
#include "stdafx.h" |
||||
|
||||
// TODO: Установите ссылки на любые требующиеся дополнительные заголовки в файле STDAFX.H
|
||||
// , а не в данном файле
|
||||
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
// stdafx.h: включаемый файл для стандартных системных включаемых файлов
|
||||
// или включаемых файлов для конкретного проекта, которые часто используются, но
|
||||
// не часто изменяются
|
||||
//
|
||||
|
||||
#pragma once |
||||
|
||||
#include "targetver.h" |
||||
|
||||
#include <stdio.h> |
||||
#include <tchar.h> |
||||
|
||||
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // некоторые конструкторы CString будут явными
|
||||
|
||||
#include <atlbase.h> |
||||
#include <atlstr.h> |
||||
|
||||
// TODO: Установите здесь ссылки на дополнительные заголовки, требующиеся для программы
|
||||
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
#pragma once |
||||
|
||||
// Включение SDKDDKVer.h обеспечивает определение самой последней доступной платформы Windows.
|
||||
|
||||
// Если требуется выполнить сборку приложения для предыдущей версии Windows, включите WinSDKVer.h и
|
||||
// задайте для макроса _WIN32_WINNT значение поддерживаемой платформы перед включением SDKDDKVer.h.
|
||||
|
||||
#include <SDKDDKVer.h> |
||||
@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00 |
||||
# Visual Studio Version 17 |
||||
VisualStudioVersion = 17.3.32929.385 |
||||
MinimumVisualStudioVersion = 10.0.40219.1 |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_img", "Test_img\Test_img.csproj", "{AE96C475-3F2E-409C-9213-A049FB9CAD10}" |
||||
EndProject |
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApplication1", "C:\Work\C++\Test_img\ConsoleApplication1\ConsoleApplication1.vcxproj", "{F7F6C86C-4770-450C-A162-194389C17D2D}" |
||||
EndProject |
||||
Global |
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
||||
Debug|Any CPU = Debug|Any CPU |
||||
Debug|x86 = Debug|x86 |
||||
Release|Any CPU = Release|Any CPU |
||||
Release|x86 = Release|x86 |
||||
EndGlobalSection |
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
||||
{AE96C475-3F2E-409C-9213-A049FB9CAD10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{AE96C475-3F2E-409C-9213-A049FB9CAD10}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{AE96C475-3F2E-409C-9213-A049FB9CAD10}.Debug|x86.ActiveCfg = Debug|Any CPU |
||||
{AE96C475-3F2E-409C-9213-A049FB9CAD10}.Debug|x86.Build.0 = Debug|Any CPU |
||||
{AE96C475-3F2E-409C-9213-A049FB9CAD10}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{AE96C475-3F2E-409C-9213-A049FB9CAD10}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{AE96C475-3F2E-409C-9213-A049FB9CAD10}.Release|x86.ActiveCfg = Release|Any CPU |
||||
{AE96C475-3F2E-409C-9213-A049FB9CAD10}.Release|x86.Build.0 = Release|Any CPU |
||||
{F7F6C86C-4770-450C-A162-194389C17D2D}.Debug|Any CPU.ActiveCfg = Debug|Win32 |
||||
{F7F6C86C-4770-450C-A162-194389C17D2D}.Debug|Any CPU.Build.0 = Debug|Win32 |
||||
{F7F6C86C-4770-450C-A162-194389C17D2D}.Debug|x86.ActiveCfg = Debug|Win32 |
||||
{F7F6C86C-4770-450C-A162-194389C17D2D}.Debug|x86.Build.0 = Debug|Win32 |
||||
{F7F6C86C-4770-450C-A162-194389C17D2D}.Release|Any CPU.ActiveCfg = Release|Win32 |
||||
{F7F6C86C-4770-450C-A162-194389C17D2D}.Release|Any CPU.Build.0 = Release|Win32 |
||||
{F7F6C86C-4770-450C-A162-194389C17D2D}.Release|x86.ActiveCfg = Release|Win32 |
||||
{F7F6C86C-4770-450C-A162-194389C17D2D}.Release|x86.Build.0 = Release|Win32 |
||||
EndGlobalSection |
||||
GlobalSection(SolutionProperties) = preSolution |
||||
HideSolutionNode = FALSE |
||||
EndGlobalSection |
||||
GlobalSection(ExtensibilityGlobals) = postSolution |
||||
SolutionGuid = {EE63C273-8D09-484A-9870-582C052D7575} |
||||
EndGlobalSection |
||||
EndGlobal |
||||
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?> |
||||
<configuration> |
||||
<startup> |
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> |
||||
</startup> |
||||
</configuration> |
||||
@ -0,0 +1,416 @@
@@ -0,0 +1,416 @@
|
||||
namespace Test_img |
||||
{ |
||||
partial class Form1 |
||||
{ |
||||
/// <summary> |
||||
/// Обязательная переменная конструктора. |
||||
/// </summary> |
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary> |
||||
/// Освободить все используемые ресурсы. |
||||
/// </summary> |
||||
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param> |
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing && (components != null)) |
||||
{ |
||||
components.Dispose(); |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
#region Код, автоматически созданный конструктором форм Windows |
||||
|
||||
/// <summary> |
||||
/// Требуемый метод для поддержки конструктора — не изменяйте |
||||
/// содержимое этого метода с помощью редактора кода. |
||||
/// </summary> |
||||
private void InitializeComponent() |
||||
{ |
||||
this.components = new System.ComponentModel.Container(); |
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip(); |
||||
this.img_resolution = new System.Windows.Forms.ToolStripStatusLabel(); |
||||
this.img_aspect = new System.Windows.Forms.ToolStripStatusLabel(); |
||||
this.img_coord = new System.Windows.Forms.ToolStripStatusLabel(); |
||||
this.img_color = new System.Windows.Forms.ToolStripStatusLabel(); |
||||
this.img_srch = new System.Windows.Forms.ToolStripStatusLabel(); |
||||
this.ttt = new System.Windows.Forms.ToolStripStatusLabel(); |
||||
this.yyy = new System.Windows.Forms.ToolStripStatusLabel(); |
||||
this.menu = new System.Windows.Forms.MenuStrip(); |
||||
this.MenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.img_load = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripSeparator(); |
||||
this.exit = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.MenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.развернутьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.свернутьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.MenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.img1 = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.img2 = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.img3 = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); |
||||
this.img_timer = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.img_smooth = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.img_center = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.minus_fon = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.img_search = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.img_fon = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.img_save = new System.Windows.Forms.ToolStripMenuItem(); |
||||
this.timer1 = new System.Windows.Forms.Timer(this.components); |
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox(); |
||||
this.statusStrip1.SuspendLayout(); |
||||
this.menu.SuspendLayout(); |
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); |
||||
this.SuspendLayout(); |
||||
// |
||||
// statusStrip1 |
||||
// |
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { |
||||
this.img_resolution, |
||||
this.img_aspect, |
||||
this.img_coord, |
||||
this.img_color, |
||||
this.img_srch, |
||||
this.ttt, |
||||
this.yyy}); |
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 543); |
||||
this.statusStrip1.Name = "statusStrip1"; |
||||
this.statusStrip1.Size = new System.Drawing.Size(650, 24); |
||||
this.statusStrip1.TabIndex = 1; |
||||
this.statusStrip1.Text = "statusStrip1"; |
||||
// |
||||
// img_resolution |
||||
// |
||||
this.img_resolution.AutoSize = false; |
||||
this.img_resolution.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right; |
||||
this.img_resolution.Name = "img_resolution"; |
||||
this.img_resolution.Size = new System.Drawing.Size(70, 19); |
||||
this.img_resolution.Text = "4000 X 3000"; |
||||
// |
||||
// img_aspect |
||||
// |
||||
this.img_aspect.AutoSize = false; |
||||
this.img_aspect.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right; |
||||
this.img_aspect.Name = "img_aspect"; |
||||
this.img_aspect.Size = new System.Drawing.Size(90, 19); |
||||
this.img_aspect.Text = "Аспект 12.999"; |
||||
// |
||||
// img_coord |
||||
// |
||||
this.img_coord.AutoSize = false; |
||||
this.img_coord.Name = "img_coord"; |
||||
this.img_coord.Size = new System.Drawing.Size(105, 19); |
||||
this.img_coord.Text = "X = 0000 Y = 0000"; |
||||
// |
||||
// img_color |
||||
// |
||||
this.img_color.AutoSize = false; |
||||
this.img_color.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); |
||||
this.img_color.Name = "img_color"; |
||||
this.img_color.Size = new System.Drawing.Size(110, 19); |
||||
this.img_color.Text = "R:000 G:000 B:000"; |
||||
// |
||||
// img_srch |
||||
// |
||||
this.img_srch.AutoSize = false; |
||||
this.img_srch.Name = "img_srch"; |
||||
this.img_srch.Size = new System.Drawing.Size(55, 19); |
||||
this.img_srch.Text = "Фон: 000"; |
||||
// |
||||
// ttt |
||||
// |
||||
this.ttt.AutoSize = false; |
||||
this.ttt.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Left; |
||||
this.ttt.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; |
||||
this.ttt.Name = "ttt"; |
||||
this.ttt.Size = new System.Drawing.Size(70, 19); |
||||
this.ttt.Text = "-0000 -0000"; |
||||
// |
||||
// yyy |
||||
// |
||||
this.yyy.AutoSize = false; |
||||
this.yyy.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Left; |
||||
this.yyy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; |
||||
this.yyy.Name = "yyy"; |
||||
this.yyy.Size = new System.Drawing.Size(70, 19); |
||||
this.yyy.Text = "0000 0000"; |
||||
// |
||||
// menu |
||||
// |
||||
this.menu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { |
||||
this.MenuItem1, |
||||
this.MenuItem2, |
||||
this.MenuItem3}); |
||||
this.menu.Location = new System.Drawing.Point(0, 0); |
||||
this.menu.Name = "menu"; |
||||
this.menu.Size = new System.Drawing.Size(650, 24); |
||||
this.menu.TabIndex = 7; |
||||
this.menu.Text = "menuStrip1"; |
||||
// |
||||
// MenuItem1 |
||||
// |
||||
this.MenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { |
||||
this.img_load, |
||||
this.toolStripMenuItem2, |
||||
this.toolStripMenuItem7, |
||||
this.exit}); |
||||
this.MenuItem1.Name = "MenuItem1"; |
||||
this.MenuItem1.Size = new System.Drawing.Size(48, 20); |
||||
this.MenuItem1.Text = "Файл"; |
||||
// |
||||
// img_load |
||||
// |
||||
this.img_load.Name = "img_load"; |
||||
this.img_load.Size = new System.Drawing.Size(210, 22); |
||||
this.img_load.Text = "Загрузить изображение"; |
||||
this.img_load.Click += new System.EventHandler(this.img_load_Click); |
||||
// |
||||
// toolStripMenuItem2 |
||||
// |
||||
this.toolStripMenuItem2.Name = "toolStripMenuItem2"; |
||||
this.toolStripMenuItem2.Size = new System.Drawing.Size(210, 22); |
||||
this.toolStripMenuItem2.Text = "Сохранить изображение"; |
||||
this.toolStripMenuItem2.Click += new System.EventHandler(this.img_save_Click); |
||||
// |
||||
// toolStripMenuItem7 |
||||
// |
||||
this.toolStripMenuItem7.Name = "toolStripMenuItem7"; |
||||
this.toolStripMenuItem7.Size = new System.Drawing.Size(207, 6); |
||||
// |
||||
// exit |
||||
// |
||||
this.exit.Name = "exit"; |
||||
this.exit.Size = new System.Drawing.Size(210, 22); |
||||
this.exit.Text = "Выход"; |
||||
this.exit.Click += new System.EventHandler(this.exit_Click); |
||||
// |
||||
// MenuItem2 |
||||
// |
||||
this.MenuItem2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { |
||||
this.развернутьToolStripMenuItem, |
||||
this.свернутьToolStripMenuItem}); |
||||
this.MenuItem2.Name = "MenuItem2"; |
||||
this.MenuItem2.Size = new System.Drawing.Size(39, 20); |
||||
this.MenuItem2.Text = "Вид"; |
||||
// |
||||
// развернутьToolStripMenuItem |
||||
// |
||||
this.развернутьToolStripMenuItem.Name = "развернутьToolStripMenuItem"; |
||||
this.развернутьToolStripMenuItem.Size = new System.Drawing.Size(135, 22); |
||||
this.развернутьToolStripMenuItem.Text = "Развернуть"; |
||||
this.развернутьToolStripMenuItem.Click += new System.EventHandler(this.развернутьToolStripMenuItem_Click); |
||||
// |
||||
// свернутьToolStripMenuItem |
||||
// |
||||
this.свернутьToolStripMenuItem.Name = "свернутьToolStripMenuItem"; |
||||
this.свернутьToolStripMenuItem.Size = new System.Drawing.Size(135, 22); |
||||
this.свернутьToolStripMenuItem.Text = "Свернуть"; |
||||
this.свернутьToolStripMenuItem.Click += new System.EventHandler(this.свернутьToolStripMenuItem_Click); |
||||
// |
||||
// MenuItem3 |
||||
// |
||||
this.MenuItem3.AutoSize = false; |
||||
this.MenuItem3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { |
||||
this.toolStripMenuItem5, |
||||
this.img_smooth, |
||||
this.img_center, |
||||
this.img_search, |
||||
this.img_fon, |
||||
this.img_save}); |
||||
this.MenuItem3.Name = "MenuItem3"; |
||||
this.MenuItem3.Size = new System.Drawing.Size(122, 20); |
||||
this.MenuItem3.Text = "Инструменты"; |
||||
// |
||||
// toolStripMenuItem5 |
||||
// |
||||
this.toolStripMenuItem5.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { |
||||
this.img1, |
||||
this.img2, |
||||
this.img3, |
||||
this.toolStripSeparator1, |
||||
this.img_timer}); |
||||
this.toolStripMenuItem5.Name = "toolStripMenuItem5"; |
||||
this.toolStripMenuItem5.Size = new System.Drawing.Size(180, 22); |
||||
this.toolStripMenuItem5.Text = "Демо-картинка"; |
||||
// |
||||
// img1 |
||||
// |
||||
this.img1.Name = "img1"; |
||||
this.img1.Size = new System.Drawing.Size(104, 22); |
||||
this.img1.Text = "1"; |
||||
this.img1.Click += new System.EventHandler(this.img1_Click); |
||||
// |
||||
// img2 |
||||
// |
||||
this.img2.Name = "img2"; |
||||
this.img2.Size = new System.Drawing.Size(104, 22); |
||||
this.img2.Text = "2"; |
||||
this.img2.Click += new System.EventHandler(this.img2_Click); |
||||
// |
||||
// img3 |
||||
// |
||||
this.img3.Name = "img3"; |
||||
this.img3.Size = new System.Drawing.Size(104, 22); |
||||
this.img3.Text = "3"; |
||||
this.img3.Click += new System.EventHandler(this.img3_Click); |
||||
// |
||||
// toolStripSeparator1 |
||||
// |
||||
this.toolStripSeparator1.Name = "toolStripSeparator1"; |
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(101, 6); |
||||
// |
||||
// img_timer |
||||
// |
||||
this.img_timer.Checked = true; |
||||
this.img_timer.CheckOnClick = true; |
||||
this.img_timer.CheckState = System.Windows.Forms.CheckState.Checked; |
||||
this.img_timer.Image = global::Test_img.Properties.Resources.CheckBoxChecked; |
||||
this.img_timer.Name = "img_timer"; |
||||
this.img_timer.Size = new System.Drawing.Size(104, 22); |
||||
this.img_timer.Text = "Timer"; |
||||
this.img_timer.Click += new System.EventHandler(this.img_timer_Click); |
||||
// |
||||
// img_smooth |
||||
// |
||||
this.img_smooth.CheckOnClick = true; |
||||
this.img_smooth.Image = global::Test_img.Properties.Resources.CheckBoxUnchecked; |
||||
this.img_smooth.Name = "img_smooth"; |
||||
this.img_smooth.Size = new System.Drawing.Size(180, 22); |
||||
this.img_smooth.Text = "Размытие"; |
||||
this.img_smooth.Click += new System.EventHandler(this.img_smooth_Click); |
||||
// |
||||
// img_center |
||||
// |
||||
this.img_center.CheckOnClick = true; |
||||
this.img_center.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { |
||||
this.minus_fon}); |
||||
this.img_center.Image = global::Test_img.Properties.Resources.CheckBoxUnchecked; |
||||
this.img_center.Name = "img_center"; |
||||
this.img_center.Size = new System.Drawing.Size(180, 22); |
||||
this.img_center.Text = "Центр масс"; |
||||
this.img_center.Click += new System.EventHandler(this.img_center_Click); |
||||
// |
||||
// minus_fon |
||||
// |
||||
this.minus_fon.CheckOnClick = true; |
||||
this.minus_fon.Image = global::Test_img.Properties.Resources.CheckBoxUnchecked; |
||||
this.minus_fon.Name = "minus_fon"; |
||||
this.minus_fon.Size = new System.Drawing.Size(180, 22); |
||||
this.minus_fon.Text = "Вычитать фон"; |
||||
this.minus_fon.Click += new System.EventHandler(this.minus_fon_Click); |
||||
// |
||||
// img_search |
||||
// |
||||
this.img_search.CheckOnClick = true; |
||||
this.img_search.Image = global::Test_img.Properties.Resources.CheckBoxUnchecked; |
||||
this.img_search.Name = "img_search"; |
||||
this.img_search.Size = new System.Drawing.Size(180, 22); |
||||
this.img_search.Text = "Поиск пятна"; |
||||
this.img_search.Click += new System.EventHandler(this.img_search_Click); |
||||
// |
||||
// img_fon |
||||
// |
||||
this.img_fon.Name = "img_fon"; |
||||
this.img_fon.Size = new System.Drawing.Size(180, 22); |
||||
this.img_fon.Text = "Фон"; |
||||
this.img_fon.Click += new System.EventHandler(this.img_fon_Click); |
||||
// |
||||
// img_save |
||||
// |
||||
this.img_save.Name = "img_save"; |
||||
this.img_save.Size = new System.Drawing.Size(180, 22); |
||||
this.img_save.Text = "Скриншот"; |
||||
this.img_save.Click += new System.EventHandler(this.screenshot_Click); |
||||
// |
||||
// timer1 |
||||
// |
||||
this.timer1.Enabled = true; |
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick); |
||||
// |
||||
// pictureBox1 |
||||
// |
||||
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
||||
| System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.pictureBox1.Location = new System.Drawing.Point(5, 27); |
||||
this.pictureBox1.Name = "pictureBox1"; |
||||
this.pictureBox1.Size = new System.Drawing.Size(640, 512); |
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; |
||||
this.pictureBox1.TabIndex = 0; |
||||
this.pictureBox1.TabStop = false; |
||||
this.pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox1_Paint); |
||||
this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown); |
||||
this.pictureBox1.MouseEnter += new System.EventHandler(this.pictureBox1_MouseEnter); |
||||
this.pictureBox1.MouseLeave += new System.EventHandler(this.pictureBox1_MouseLeave); |
||||
this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove); |
||||
this.pictureBox1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseUp); |
||||
// |
||||
// Form1 |
||||
// |
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
||||
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; |
||||
this.ClientSize = new System.Drawing.Size(650, 567); |
||||
this.Controls.Add(this.statusStrip1); |
||||
this.Controls.Add(this.menu); |
||||
this.Controls.Add(this.pictureBox1); |
||||
this.DoubleBuffered = true; |
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; |
||||
this.MainMenuStrip = this.menu; |
||||
this.MinimizeBox = false; |
||||
this.MinimumSize = new System.Drawing.Size(666, 606); |
||||
this.Name = "Form1"; |
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; |
||||
this.Text = "Form1"; |
||||
this.Load += new System.EventHandler(this.Form1_Load); |
||||
this.SizeChanged += new System.EventHandler(this.Form1_SizeChanged); |
||||
this.statusStrip1.ResumeLayout(false); |
||||
this.statusStrip1.PerformLayout(); |
||||
this.menu.ResumeLayout(false); |
||||
this.menu.PerformLayout(); |
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); |
||||
this.ResumeLayout(false); |
||||
this.PerformLayout(); |
||||
|
||||
} |
||||
|
||||
#endregion |
||||
|
||||
private System.Windows.Forms.PictureBox pictureBox1; |
||||
private System.Windows.Forms.StatusStrip statusStrip1; |
||||
private System.Windows.Forms.MenuStrip menu; |
||||
private System.Windows.Forms.ToolStripMenuItem MenuItem1; |
||||
private System.Windows.Forms.ToolStripMenuItem img_load; |
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; |
||||
private System.Windows.Forms.ToolStripMenuItem exit; |
||||
private System.Windows.Forms.ToolStripMenuItem MenuItem2; |
||||
private System.Windows.Forms.ToolStripMenuItem MenuItem3; |
||||
private System.Windows.Forms.ToolStripMenuItem развернутьToolStripMenuItem; |
||||
private System.Windows.Forms.ToolStripMenuItem свернутьToolStripMenuItem; |
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5; |
||||
private System.Windows.Forms.ToolStripMenuItem img_center; |
||||
private System.Windows.Forms.ToolStripStatusLabel img_resolution; |
||||
private System.Windows.Forms.ToolStripStatusLabel img_aspect; |
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem7; |
||||
private System.Windows.Forms.ToolStripStatusLabel img_coord; |
||||
private System.Windows.Forms.ToolStripStatusLabel img_color; |
||||
private System.Windows.Forms.ToolStripMenuItem img_search; |
||||
private System.Windows.Forms.ToolStripStatusLabel img_srch; |
||||
private System.Windows.Forms.ToolStripMenuItem img_save; |
||||
private System.Windows.Forms.ToolStripStatusLabel ttt; |
||||
private System.Windows.Forms.ToolStripStatusLabel yyy; |
||||
private System.Windows.Forms.ToolStripMenuItem img1; |
||||
private System.Windows.Forms.ToolStripMenuItem img2; |
||||
private System.Windows.Forms.ToolStripMenuItem img3; |
||||
private System.Windows.Forms.ToolStripMenuItem img_fon; |
||||
private System.Windows.Forms.Timer timer1; |
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; |
||||
private System.Windows.Forms.ToolStripMenuItem img_timer; |
||||
private System.Windows.Forms.ToolStripMenuItem img_smooth; |
||||
private System.Windows.Forms.ToolStripMenuItem minus_fon; |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,567 @@
@@ -0,0 +1,567 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Diagnostics; |
||||
using System.Drawing; |
||||
using System.Drawing.Drawing2D; |
||||
using System.Drawing.Imaging; |
||||
using System.Reflection; |
||||
using System.Windows.Forms; |
||||
using UTIL; |
||||
|
||||
namespace Test_img |
||||
{ |
||||
public partial class Form1 : Form |
||||
{ |
||||
Bitmap bm = null; |
||||
Bitmap newbm = null; |
||||
//int ter1 = 0; |
||||
//int ter2 = 0; |
||||
//int wMax = 0; |
||||
//int hMax = 0; |
||||
//int wMaxF = 0; |
||||
//int hMaxF = 0; |
||||
//int panelR = 117; |
||||
//int panelD = 84; |
||||
int xPos; |
||||
int yPos; |
||||
|
||||
float zoomFactor = 1; |
||||
Size resolution = new Size(0, 0); |
||||
Size minform = new Size(666, 606); |
||||
private Point startingPoint = Point.Empty; |
||||
private Point movingPoint = Point.Empty; |
||||
private bool panning = false; |
||||
private bool select = false; |
||||
private Point startSelPoint = Point.Empty; |
||||
private Point stopSelPoint = Point.Empty; |
||||
private Point SelPoint1 = Point.Empty; |
||||
private Point SelPoint2 = Point.Empty; |
||||
private Point MassCenter = Point.Empty; |
||||
search srch = new search(); |
||||
int imgsearch = 200; |
||||
UInt32 fon = 200; |
||||
|
||||
public Form1() |
||||
{ |
||||
InitializeComponent(); |
||||
} |
||||
|
||||
private void Form1_Load(object sender, EventArgs e) |
||||
{ |
||||
pictureBox1.MouseWheel += new MouseEventHandler(pictureBox1_MouseWheel); |
||||
resolution = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size; |
||||
img_aspect.Text = $"Аспект: {zoomFactor:F3}"; |
||||
StaticData.ValueChanged += (sender1, e1) => |
||||
{ |
||||
imgsearch = StaticData.DataBuffer; |
||||
//img_srch.Text = StaticData.DataBuffer.ToString(); |
||||
}; |
||||
StaticData.SHandlerSearch = new StaticData.SHandler(SearchPixel); |
||||
pictureBox1.Image = bm = new Bitmap(pictureBox1.Width, pictureBox1.Height); |
||||
StaticData.TrgEventHandler += SearchPixel2; |
||||
|
||||
} |
||||
private void Form1_SizeChanged(object sender, EventArgs e) |
||||
{ |
||||
if (this.WindowState != FormWindowState.Maximized) |
||||
{ |
||||
this.WindowState = FormWindowState.Normal; |
||||
this.Size = minform; |
||||
this.Location = new Point(resolution.Width / 2 - minform.Width / 2, resolution.Height / 2 - minform.Height / 2); |
||||
Console.WriteLine($"{pictureBox1.Size.Width} {pictureBox1.Size.Height} {pictureBox1.Location.X} {pictureBox1.Location.Y}"); |
||||
this.CenterToScreen(); |
||||
} |
||||
else |
||||
{ |
||||
this.WindowState = FormWindowState.Maximized; |
||||
this.CenterToScreen(); |
||||
Console.WriteLine($"{pictureBox1.Size.Width} {pictureBox1.Size.Height} {pictureBox1.Location.X} {pictureBox1.Location.Y}"); |
||||
} |
||||
movingPoint = new Point((pictureBox1.Width - bm.Width) / 2, (pictureBox1.Height - bm.Height) / 2); |
||||
pictureBox1.Invalidate(); |
||||
} |
||||
private void pictureBox1_MouseEnter(object sender, EventArgs e) |
||||
{ |
||||
pictureBox1.MouseWheel += pictureBox1_MouseWheel; |
||||
pictureBox1.Cursor = Cursors.Cross; |
||||
} |
||||
private void pictureBox1_MouseLeave(object sender, EventArgs e) |
||||
{ |
||||
pictureBox1.MouseWheel -= pictureBox1_MouseWheel; |
||||
pictureBox1.Cursor = Cursors.Default; |
||||
} |
||||
private void pictureBox1_MouseWheel(object sender, MouseEventArgs e) |
||||
{ |
||||
pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Normal; |
||||
float zf = zoomFactor; |
||||
if(bm != null) |
||||
{ |
||||
if (e.Delta > 0 && zoomFactor * bm.Width < 8100) |
||||
{ |
||||
zoomFactor *= 1.1F; |
||||
} |
||||
if (e.Delta < 0 && zoomFactor * bm.Width > 100) |
||||
{ |
||||
zoomFactor /= 1.1F; |
||||
} |
||||
img_aspect.Text = $"Аспект: {zoomFactor:F3}"; |
||||
movingPoint.X -= (int)(bm.Width * zoomFactor - bm.Width * zf) / 2; |
||||
movingPoint.Y -= (int)(bm.Height * zoomFactor - bm.Height * zf) / 2; |
||||
|
||||
pictureBox1.Invalidate(); |
||||
} |
||||
} |
||||
private void pictureBox1_MouseDown(object sender, MouseEventArgs e) |
||||
{ |
||||
if (e.Button == MouseButtons.Left) |
||||
{ |
||||
//Console.WriteLine($"X={e.X} Y={e.Y} " + |
||||
// $"w={bm.Width * zoomFactor} h={bm.Height * zoomFactor} " + // размер картинки |
||||
// $"mpx={movingPoint.X} mpy={movingPoint.Y} " + // картинка в боксе |
||||
// $"xpos={xPos} ypos={yPos} " + // мышь в боксе |
||||
// $"mx={xPos - movingPoint.X} my={yPos - movingPoint.Y} " + // мышь в картинке в боксе |
||||
// $"mx={(xPos - movingPoint.X) / zoomFactor} my={(yPos - movingPoint.Y) / zoomFactor} " + // мышь в картинке в боксе |
||||
// $"z={zoomFactor}"); |
||||
select = true; |
||||
startSelPoint = new Point(e.Location.X, e.Location.Y); |
||||
stopSelPoint = new Point(e.Location.X, e.Location.Y); |
||||
int xx = minmax<int>(0, bm.Width - 1, (int)((xPos - movingPoint.X) / zoomFactor)); |
||||
int yy = minmax<int>(0, bm.Height - 1, (int)((yPos - movingPoint.Y) / zoomFactor)); |
||||
SelPoint1 = new Point(xx, yy); |
||||
SelPoint2 = new Point(xx, yy); |
||||
} |
||||
if (e.Button == MouseButtons.Middle) |
||||
{ |
||||
panning = true; |
||||
startingPoint = new Point(e.Location.X - movingPoint.X, e.Location.Y - movingPoint.Y); |
||||
} |
||||
} |
||||
private void pictureBox1_MouseUp(object sender, MouseEventArgs e) |
||||
{ |
||||
if (e.Button == MouseButtons.Left) |
||||
{ |
||||
select = false; |
||||
int xx = minmax<int>(0, bm.Width - 1, (int)((xPos - movingPoint.X) / zoomFactor)); |
||||
int yy = minmax<int>(0, bm.Height - 1, (int)((yPos - movingPoint.Y) / zoomFactor)); |
||||
SelPoint2 = new Point(xx, yy); |
||||
//Console.WriteLine($"x1 {SelPoint1.X} y1 {SelPoint1.Y} x3 {SelPoint2.X} y3 {SelPoint2.Y}"); |
||||
Rectangle r = nrect(SelPoint1, SelPoint2); |
||||
Console.WriteLine($"x1 {r.X} y1 {r.Y} x3 {r.X + r.Width} y3 {r.Y + r.Height}"); |
||||
MassCenter = CalcCenterMass(r); |
||||
Console.WriteLine($"x {MassCenter.X} y {MassCenter.Y}"); |
||||
} |
||||
if (e.Button == MouseButtons.Middle) |
||||
{ |
||||
panning = false; |
||||
} |
||||
} |
||||
private void pictureBox1_MouseMove(object sender, MouseEventArgs e) |
||||
{ |
||||
xPos = e.X; // мышь в боксе |
||||
yPos = e.Y; |
||||
if (panning) |
||||
{ |
||||
movingPoint = new Point(e.Location.X - startingPoint.X, e.Location.Y - startingPoint.Y); |
||||
pictureBox1.Invalidate(); |
||||
} |
||||
if (select) |
||||
{ |
||||
stopSelPoint = new Point(e.Location.X, e.Location.Y); |
||||
int xx = minmax<int>(0, bm.Width - 1, (int)((xPos - movingPoint.X) / zoomFactor)); |
||||
int yy = minmax<int>(0, bm.Height - 1, (int)((yPos - movingPoint.Y) / zoomFactor)); |
||||
SelPoint2 = new Point(xx, yy); |
||||
//using (Graphics g = pictureBox1.CreateGraphics()) |
||||
//{ |
||||
// g.DrawRectangle(new Pen(Color.Green, 1), nrect(startSelPoint, stopSelPoint)); |
||||
//} |
||||
//pictureBox1.Invalidate(); |
||||
} |
||||
if(bm != null) |
||||
{ |
||||
int xx = minmax<int>(0, bm.Width - 1, (int)((xPos - movingPoint.X) / zoomFactor)); |
||||
int yy = minmax<int>(0, bm.Height - 1, (int)((yPos - movingPoint.Y) / zoomFactor)); |
||||
img_color.Text = $"R:{bm.GetPixel(xx, yy).R:D3} G:{bm.GetPixel(xx, yy).G:D3} B:{bm.GetPixel(xx, yy).B:D3}"; |
||||
img_coord.Text = $"X = {xx:D4} Y = {yy:D4}"; |
||||
ttt.Text = $"{movingPoint.X:D4} {movingPoint.Y:D4}"; |
||||
yyy.Text = $"{xPos:D4} {yPos:D4}"; |
||||
} |
||||
} |
||||
private void pictureBox1_Paint(object sender, PaintEventArgs e) |
||||
{ |
||||
e.Graphics.Clear(Color.White); |
||||
if (newbm != null) |
||||
e.Graphics.DrawImage(ResizeImage(newbm, zoomFactor), movingPoint); |
||||
if (select) |
||||
e.Graphics.DrawRectangle(new Pen(Color.Green, 1), nrect(startSelPoint, stopSelPoint)); |
||||
if (img_center.Checked) |
||||
{ |
||||
e.Graphics.DrawLine(new Pen(Color.LimeGreen, 1), |
||||
BmToPb(MassCenter).X, |
||||
BmToPb(MassCenter).Y - 20, |
||||
BmToPb(MassCenter).X, |
||||
BmToPb(MassCenter).Y + 20); |
||||
e.Graphics.DrawLine(new Pen(Color.LimeGreen, 1), |
||||
BmToPb(MassCenter).X - 20, |
||||
BmToPb(MassCenter).Y, |
||||
BmToPb(MassCenter).X + 20, |
||||
BmToPb(MassCenter).Y); |
||||
e.Graphics.DrawRectangle(new Pen(Color.LimeGreen, 1), BmToPb(MassCenter).X - 20, BmToPb(MassCenter).Y - 20, 40, 40); |
||||
} |
||||
GC.Collect(); |
||||
} |
||||
public Bitmap ResizeImage(Image image, float zoom) |
||||
{ |
||||
var destRect = new Rectangle(0, 0, (int)(image.Width * zoom), (int)(image.Height * zoom)); |
||||
var destImage = new Bitmap((int)(image.Width * zoom), (int)(image.Height * zoom)); |
||||
|
||||
//destImage.SetResolution(image.HorizontalResolution, image.VerticalResolution); |
||||
|
||||
using (var graphics = Graphics.FromImage(destImage)) |
||||
{ |
||||
graphics.CompositingMode = CompositingMode.SourceCopy; |
||||
graphics.CompositingQuality = CompositingQuality.HighQuality; |
||||
if(img_smooth.Checked) |
||||
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; |
||||
else |
||||
graphics.InterpolationMode = InterpolationMode.NearestNeighbor; |
||||
graphics.SmoothingMode = SmoothingMode.HighQuality; |
||||
graphics.PixelOffsetMode = PixelOffsetMode.Half; |
||||
|
||||
using (var wrapMode = new ImageAttributes()) |
||||
{ |
||||
wrapMode.SetWrapMode(WrapMode.TileFlipXY); |
||||
//graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, wrapMode); |
||||
graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel); |
||||
} |
||||
} |
||||
return destImage; |
||||
} |
||||
private T minmax<T>(T min, T max, T val) where T : IComparable<T> |
||||
{ |
||||
if (val.CompareTo(min) <= 0) |
||||
return min; |
||||
if (val.CompareTo(max) > 0) |
||||
return max; |
||||
return val; |
||||
} |
||||
private Rectangle nrect(Point p1, Point p3) |
||||
{ |
||||
Rectangle r = Rectangle.Empty; |
||||
Point p2 = new Point(p3.X, p1.Y); |
||||
Point p4 = new Point(p1.X, p3.Y); |
||||
|
||||
if (p1.X < p3.X && p1.Y < p3.Y) |
||||
return new Rectangle(p1, new Size(p3.X - p1.X, p3.Y - p1.Y)); |
||||
if (p1.X < p3.X && p1.Y > p3.Y) |
||||
return new Rectangle(p4, new Size(p3.X - p4.X, p1.Y - p4.Y)); |
||||
if (p1.X > p3.X && p1.Y < p3.Y) |
||||
return new Rectangle(p2, new Size(p1.X - p2.X, p3.Y - p2.Y)); |
||||
if (p1.X > p3.X && p1.Y > p3.Y) |
||||
return new Rectangle(p3, new Size(p4.X - p3.X, p2.Y - p3.Y)); |
||||
return r; |
||||
} |
||||
private void SearchPixel() |
||||
{ |
||||
List<Point> points = new List<Point>(); |
||||
Stopwatch stopwatch = Stopwatch.StartNew(); |
||||
UnsafeBitmap btm = new UnsafeBitmap(bm); |
||||
btm.LockBitmap(); |
||||
for (int y = 0; y < bm.Height; y++) |
||||
{ |
||||
for (int x = 0; x < bm.Width; x++) |
||||
{ |
||||
PixelData c = btm.GetPixel(x, y); |
||||
if (c.blue >= imgsearch) |
||||
{ |
||||
points.Add(new Point(x, y)); |
||||
//Console.WriteLine($"{x} {y}"); |
||||
} |
||||
} |
||||
} |
||||
stopwatch.Stop(); |
||||
Console.WriteLine(stopwatch.Elapsed.ToString()); |
||||
btm.Dispose(); |
||||
using (Graphics g = Graphics.FromImage(newbm)) |
||||
{ |
||||
//g.Clear(Color.White); |
||||
for (int i = 0; i < points.Count; i++) |
||||
g.DrawEllipse(new Pen(Color.Red), points[i].X - 5, points[i].Y - 5, 10, 10); |
||||
|
||||
} |
||||
pictureBox1.Invalidate(); |
||||
} |
||||
private Point CalcCenterMass(Rectangle r) |
||||
{ |
||||
Int32 sX = 0; |
||||
Int32 sY = 0; |
||||
Int32 sZ = 0; |
||||
if (r.Width != 0 && r.Height != 0) |
||||
{ |
||||
UnsafeBitmap btm = new UnsafeBitmap(bm); |
||||
btm.LockBitmap(); |
||||
Int32 num = 1; |
||||
for (int y = r.Y; y < r.Bottom; y++) |
||||
{ |
||||
for (int x = r.X; x < r.Right; x++) |
||||
{ |
||||
PixelData c = btm.GetPixel(x, y); |
||||
if (minus_fon.Checked) |
||||
{ |
||||
sX += (Int32)((c.blue - fon) * x); |
||||
sY += (Int32)((c.blue - fon) * y); |
||||
sZ += (Int32)(c.blue - fon); |
||||
} |
||||
else |
||||
{ |
||||
sX += (Int32)(c.blue * x); |
||||
sY += (Int32)(c.blue * y); |
||||
sZ += (Int32)(c.blue); |
||||
} |
||||
num++; |
||||
} |
||||
} |
||||
//sX /= 255; |
||||
//sY /= 255; |
||||
//sX /= num - 1; |
||||
//sY /= num - 1; |
||||
sX /= sZ; |
||||
sY /= sZ; |
||||
btm.Dispose(); |
||||
Console.WriteLine($"num: {num} num2: {r.Width * r.Height} x: {sX} y: {sY}"); |
||||
return new Point(sX, sY); |
||||
} |
||||
else |
||||
return Point.Empty; |
||||
} |
||||
private Point BmToPb(Point p) |
||||
{ |
||||
return new Point((int)(p.X * zoomFactor + movingPoint.X), (int)(p.Y * zoomFactor + movingPoint.Y)); |
||||
} |
||||
|
||||
#region Меню |
||||
private void img_load_Click(object sender, EventArgs e) |
||||
{ |
||||
OpenFileDialog ofd = new OpenFileDialog(); |
||||
ofd.Filter = "bitmap files (*.bmp)|*.bmp|All files (*.*)|*.*"; |
||||
if (ofd.ShowDialog() != DialogResult.OK) |
||||
return; |
||||
bm = (Bitmap)Image.FromFile(ofd.FileNames[0]); |
||||
newbm = (Bitmap)bm.Clone(); |
||||
img_resolution.Text = $"{bm.Width} X {bm.Height}"; |
||||
this.CenterToScreen(); |
||||
zoomFactor = (float)pictureBox1.Width / (float)bm.Width; |
||||
zoomFactor = 1; |
||||
img_aspect.Text = $"Аспект: {zoomFactor:F3}"; |
||||
movingPoint = new Point((pictureBox1.Width - bm.Width) / 2, (pictureBox1.Height - bm.Height) / 2); |
||||
pictureBox1.Invalidate(); |
||||
//pictureBox1.Image = ZoomControl(bm, zoomFactor); |
||||
} |
||||
private void exit_Click(object sender, EventArgs e) |
||||
{ |
||||
Application.Exit(); |
||||
} |
||||
private void развернутьToolStripMenuItem_Click(object sender, EventArgs e) |
||||
{ |
||||
this.WindowState = FormWindowState.Maximized; |
||||
this.CenterToScreen(); |
||||
movingPoint = new Point((pictureBox1.Width - bm.Width) / 2, (pictureBox1.Height - bm.Height) / 2); |
||||
pictureBox1.Invalidate(); |
||||
img_aspect.Text = $"Аспект: {zoomFactor:F3}"; |
||||
} |
||||
private void свернутьToolStripMenuItem_Click(object sender, EventArgs e) |
||||
{ |
||||
this.WindowState = FormWindowState.Normal; |
||||
this.Size = new Size(666, 606); |
||||
this.CenterToScreen(); |
||||
movingPoint = new Point((pictureBox1.Width - bm.Width) / 2, (pictureBox1.Height - bm.Height) / 2); |
||||
pictureBox1.Invalidate(); |
||||
img_aspect.Text = $"Аспект: {zoomFactor:F3}"; |
||||
} |
||||
private void img_search_Click(object sender, EventArgs e) |
||||
{ |
||||
if (img_search.Checked) |
||||
{ |
||||
img_search.Image = Properties.Resources.CheckBoxChecked; |
||||
srch.Show(); |
||||
StaticData.Fon?.Invoke(fon); |
||||
} |
||||
else |
||||
{ |
||||
img_search.Image = Properties.Resources.CheckBoxUnchecked; |
||||
srch.Hide(); |
||||
} |
||||
} |
||||
private void img_save_Click(object sender, EventArgs e) |
||||
{ |
||||
SaveFileDialog sfd = new SaveFileDialog(); |
||||
sfd.Filter = "bitmap files (*.bmp)|*.bmp|All files (*.*)|*.*"; |
||||
if (sfd.ShowDialog() != DialogResult.OK) |
||||
return; |
||||
lock (this) |
||||
{ |
||||
newbm.Save(sfd.FileName, ImageFormat.Bmp); |
||||
} |
||||
} |
||||
private void screenshot_Click(object sender, EventArgs e) |
||||
{ |
||||
using (Bitmap bitmap = new Bitmap(pictureBox1.Width, pictureBox1.Height)) |
||||
{ |
||||
using (Graphics g = Graphics.FromImage(bitmap)) |
||||
{ |
||||
g.CopyFromScreen(new Point(this.Bounds.Left + pictureBox1.Left + 9, this.Bounds.Top + pictureBox1.Top + 32), Point.Empty, pictureBox1.Size); |
||||
} |
||||
SaveFileDialog sfd = new SaveFileDialog(); |
||||
sfd.Filter = "bitmap files (*.bmp)|*.bmp|All files (*.*)|*.*"; |
||||
if (sfd.ShowDialog() != DialogResult.OK) |
||||
return; |
||||
bitmap.Save(sfd.FileName, ImageFormat.Bmp); |
||||
} |
||||
} |
||||
private void img_smooth_Click(object sender, EventArgs e) |
||||
{ |
||||
if (img_smooth.Checked) |
||||
img_smooth.Image = Properties.Resources.CheckBoxChecked; |
||||
else |
||||
img_smooth.Image = Properties.Resources.CheckBoxUnchecked; |
||||
|
||||
pictureBox1.Invalidate(); |
||||
} |
||||
#endregion |
||||
|
||||
#region Загрузка тестовых картинок |
||||
private void img1_Click(object sender, EventArgs e) |
||||
{ |
||||
bm = Properties.Resources.olo_02; |
||||
newbm = (Bitmap)bm.Clone(); |
||||
img_resolution.Text = $"{bm.Width} X {bm.Height}"; |
||||
this.CenterToScreen(); |
||||
zoomFactor = 1; |
||||
img_aspect.Text = $"Аспект: {zoomFactor:F3}"; |
||||
movingPoint = new Point((pictureBox1.Width - bm.Width) / 2, (pictureBox1.Height - bm.Height) / 2); |
||||
pictureBox1.Invalidate(); |
||||
imgfon(); |
||||
} |
||||
private void img2_Click(object sender, EventArgs e) |
||||
{ |
||||
bm = Properties.Resources.olo_03; |
||||
newbm = (Bitmap)bm.Clone(); |
||||
img_resolution.Text = $"{bm.Width} X {bm.Height}"; |
||||
this.CenterToScreen(); |
||||
zoomFactor = 1; |
||||
img_aspect.Text = $"Аспект: {zoomFactor:F3}"; |
||||
movingPoint = new Point((pictureBox1.Width - bm.Width) / 2, (pictureBox1.Height - bm.Height) / 2); |
||||
pictureBox1.Invalidate(); |
||||
imgfon(); |
||||
} |
||||
private void img3_Click(object sender, EventArgs e) |
||||
{ |
||||
bm = Properties.Resources.t1_320x256; |
||||
newbm = (Bitmap)bm.Clone(); |
||||
img_resolution.Text = $"{bm.Width} X {bm.Height}"; |
||||
this.CenterToScreen(); |
||||
zoomFactor = 1; |
||||
img_aspect.Text = $"Аспект: {zoomFactor:F3}"; |
||||
movingPoint = new Point((pictureBox1.Width - bm.Width) / 2, (pictureBox1.Height - bm.Height) / 2); |
||||
pictureBox1.Invalidate(); |
||||
imgfon(); |
||||
} |
||||
#endregion |
||||
|
||||
private void SearchPixel2() |
||||
{ |
||||
} |
||||
|
||||
private void img_fon_Click(object sender, EventArgs e) |
||||
{ |
||||
UnsafeBitmap btm = new UnsafeBitmap(bm); |
||||
btm.LockBitmap(); |
||||
UInt32 sc = 0; |
||||
for (int y = 0; y < bm.Height; y++) |
||||
{ |
||||
PixelData c = btm.GetPixel(y, y); |
||||
sc += (UInt32)(c.blue * c.blue); |
||||
c = btm.GetPixel(bm.Width - 1 - y, y); |
||||
sc += (UInt32)(c.blue * c.blue); |
||||
} |
||||
Console.WriteLine(sc.ToString()); |
||||
sc = (UInt32)Math.Sqrt(sc / bm.Height / 2); |
||||
Console.WriteLine(sc.ToString()); |
||||
|
||||
img_srch.Text = $"Фон: {sc}"; |
||||
btm.UnlockBitmap(); |
||||
btm.Dispose(); |
||||
fon = sc; |
||||
StaticData.Fon?.Invoke(sc); |
||||
} |
||||
private void imgfon() |
||||
{ |
||||
UnsafeBitmap btm = new UnsafeBitmap(bm); |
||||
btm.LockBitmap(); |
||||
UInt32 sc = 0; |
||||
for (int y = 0; y < bm.Height; y++) |
||||
{ |
||||
PixelData c = btm.GetPixel(y, y); |
||||
sc += (UInt32)(c.blue * c.blue); |
||||
c = btm.GetPixel(bm.Width - 1 - y, y); |
||||
sc += (UInt32)(c.blue * c.blue); |
||||
} |
||||
Console.WriteLine(sc.ToString()); |
||||
sc = (UInt32)Math.Sqrt(sc / bm.Height / 2); |
||||
Console.WriteLine(sc.ToString()); |
||||
|
||||
img_srch.Text = $"Фон: {sc}"; |
||||
btm.UnlockBitmap(); |
||||
btm.Dispose(); |
||||
fon = sc; |
||||
StaticData.Fon?.Invoke(sc); |
||||
} |
||||
|
||||
private void img_timer_Click(object sender, EventArgs e) |
||||
{ |
||||
if (img_timer.Checked) |
||||
{ |
||||
img_timer.Image = Properties.Resources.CheckBoxChecked; |
||||
timer1.Enabled = true; |
||||
} |
||||
else |
||||
{ |
||||
img_timer.Image = Properties.Resources.CheckBoxUnchecked; |
||||
timer1.Enabled = false; |
||||
} |
||||
} |
||||
|
||||
private void timer1_Tick(object sender, EventArgs e) |
||||
{ |
||||
newbm = (Bitmap)bm.Clone(); |
||||
if (img_search.Checked) |
||||
{ |
||||
SearchPixel(); |
||||
} |
||||
pictureBox1.Invalidate(); |
||||
} |
||||
|
||||
private void img_center_Click(object sender, EventArgs e) |
||||
{ |
||||
if (img_center.Checked) |
||||
{ |
||||
img_center.Image = Properties.Resources.CheckBoxChecked; |
||||
} |
||||
else |
||||
{ |
||||
img_center.Image = Properties.Resources.CheckBoxUnchecked; |
||||
} |
||||
} |
||||
|
||||
private void minus_fon_Click(object sender, EventArgs e) |
||||
{ |
||||
if (minus_fon.Checked) |
||||
{ |
||||
minus_fon.Image = Properties.Resources.CheckBoxChecked; |
||||
} |
||||
else |
||||
{ |
||||
minus_fon.Image = Properties.Resources.CheckBoxUnchecked; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,132 @@
@@ -0,0 +1,132 @@
|
||||
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<resheader name="writer"> |
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
||||
<value>18, 0</value> |
||||
</metadata> |
||||
<metadata name="menu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
||||
<value>127, 3</value> |
||||
</metadata> |
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
||||
<value>210, 3</value> |
||||
</metadata> |
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
||||
<value>59</value> |
||||
</metadata> |
||||
</root> |
||||
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Threading.Tasks; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace Test_img |
||||
{ |
||||
internal static class Program |
||||
{ |
||||
/// <summary> |
||||
/// Главная точка входа для приложения. |
||||
/// </summary> |
||||
[STAThread] |
||||
static void Main() |
||||
{ |
||||
Application.EnableVisualStyles(); |
||||
Application.SetCompatibleTextRenderingDefault(false); |
||||
Application.Run(new Form1()); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
// Общие сведения об этой сборке предоставляются следующим набором |
||||
// набора атрибутов. Измените значения этих атрибутов для изменения сведений, |
||||
// связанных со сборкой. |
||||
[assembly: AssemblyTitle("Test_img")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("Test_img")] |
||||
[assembly: AssemblyCopyright("Copyright © 2024")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми |
||||
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через |
||||
// COM, следует установить атрибут ComVisible в TRUE для этого типа. |
||||
[assembly: ComVisible(false)] |
||||
|
||||
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM |
||||
[assembly: Guid("ae96c475-3f2e-409c-9213-a049fb9cad10")] |
||||
|
||||
// Сведения о версии сборки состоят из указанных ниже четырех значений: |
||||
// |
||||
// Основной номер версии |
||||
// Дополнительный номер версии |
||||
// Номер сборки |
||||
// Редакция |
||||
// |
||||
// Можно задать все значения или принять номера сборки и редакции по умолчанию |
||||
// используя "*", как показано ниже: |
||||
// [assembly: AssemblyVersion("1.0.*")] |
||||
[assembly: AssemblyVersion("1.0.0.0")] |
||||
[assembly: AssemblyFileVersion("1.0.0.0")] |
||||
@ -0,0 +1,123 @@
@@ -0,0 +1,123 @@
|
||||
//------------------------------------------------------------------------------ |
||||
// <auto-generated> |
||||
// Этот код создан программой. |
||||
// Исполняемая версия:4.0.30319.42000 |
||||
// |
||||
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае |
||||
// повторной генерации кода. |
||||
// </auto-generated> |
||||
//------------------------------------------------------------------------------ |
||||
|
||||
namespace Test_img.Properties { |
||||
using System; |
||||
|
||||
|
||||
/// <summary> |
||||
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. |
||||
/// </summary> |
||||
// Этот класс создан автоматически классом StronglyTypedResourceBuilder |
||||
// с помощью такого средства, как ResGen или Visual Studio. |
||||
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen |
||||
// с параметром /str или перестройте свой проект VS. |
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
||||
internal class Resources { |
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan; |
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture; |
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] |
||||
internal Resources() { |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. |
||||
/// </summary> |
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] |
||||
internal static global::System.Resources.ResourceManager ResourceManager { |
||||
get { |
||||
if (object.ReferenceEquals(resourceMan, null)) { |
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Test_img.Properties.Resources", typeof(Resources).Assembly); |
||||
resourceMan = temp; |
||||
} |
||||
return resourceMan; |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Перезаписывает свойство CurrentUICulture текущего потока для всех |
||||
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. |
||||
/// </summary> |
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] |
||||
internal static global::System.Globalization.CultureInfo Culture { |
||||
get { |
||||
return resourceCulture; |
||||
} |
||||
set { |
||||
resourceCulture = value; |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap. |
||||
/// </summary> |
||||
internal static System.Drawing.Bitmap CheckBoxChecked { |
||||
get { |
||||
object obj = ResourceManager.GetObject("CheckBoxChecked", resourceCulture); |
||||
return ((System.Drawing.Bitmap)(obj)); |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap. |
||||
/// </summary> |
||||
internal static System.Drawing.Bitmap CheckBoxUnchecked { |
||||
get { |
||||
object obj = ResourceManager.GetObject("CheckBoxUnchecked", resourceCulture); |
||||
return ((System.Drawing.Bitmap)(obj)); |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap. |
||||
/// </summary> |
||||
internal static System.Drawing.Bitmap i1 { |
||||
get { |
||||
object obj = ResourceManager.GetObject("i1", resourceCulture); |
||||
return ((System.Drawing.Bitmap)(obj)); |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap. |
||||
/// </summary> |
||||
internal static System.Drawing.Bitmap olo_02 { |
||||
get { |
||||
object obj = ResourceManager.GetObject("olo_02", resourceCulture); |
||||
return ((System.Drawing.Bitmap)(obj)); |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap. |
||||
/// </summary> |
||||
internal static System.Drawing.Bitmap olo_03 { |
||||
get { |
||||
object obj = ResourceManager.GetObject("olo_03", resourceCulture); |
||||
return ((System.Drawing.Bitmap)(obj)); |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap. |
||||
/// </summary> |
||||
internal static System.Drawing.Bitmap t1_320x256 { |
||||
get { |
||||
object obj = ResourceManager.GetObject("t1_320x256", resourceCulture); |
||||
return ((System.Drawing.Bitmap)(obj)); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,139 @@
@@ -0,0 +1,139 @@
|
||||
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<resheader name="writer"> |
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
||||
<data name="olo_03" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
||||
<value>..\Resources\olo_03.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
||||
</data> |
||||
<data name="t1_320x256" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
||||
<value>..\Resources\t1-320x256.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
||||
</data> |
||||
<data name="olo_02" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
||||
<value>..\Resources\olo_02.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
||||
</data> |
||||
<data name="i1" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
||||
<value>..\Resources\i1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
||||
</data> |
||||
<data name="CheckBoxChecked" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
||||
<value>..\Resources\CheckBoxChecked.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
||||
</data> |
||||
<data name="CheckBoxUnchecked" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
||||
<value>..\Resources\CheckBoxUnchecked.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
||||
</data> |
||||
</root> |
||||
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------ |
||||
// <auto-generated> |
||||
// This code was generated by a tool. |
||||
// Runtime Version:4.0.30319.42000 |
||||
// |
||||
// Changes to this file may cause incorrect behavior and will be lost if |
||||
// the code is regenerated. |
||||
// </auto-generated> |
||||
//------------------------------------------------------------------------------ |
||||
|
||||
namespace Test_img.Properties |
||||
{ |
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] |
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase |
||||
{ |
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); |
||||
|
||||
public static Settings Default |
||||
{ |
||||
get |
||||
{ |
||||
return defaultInstance; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?> |
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> |
||||
<Profiles> |
||||
<Profile Name="(Default)" /> |
||||
</Profiles> |
||||
<Settings /> |
||||
</SettingsFile> |
||||
|
After Width: | Height: | Size: 465 B |
|
After Width: | Height: | Size: 332 B |
|
After Width: | Height: | Size: 180 B |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
@ -0,0 +1,114 @@
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
||||
<PropertyGroup> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProjectGuid>{AE96C475-3F2E-409C-9213-A049FB9CAD10}</ProjectGuid> |
||||
<OutputType>WinExe</OutputType> |
||||
<RootNamespace>Test_img</RootNamespace> |
||||
<AssemblyName>Test_img</AssemblyName> |
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> |
||||
<FileAlignment>512</FileAlignment> |
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> |
||||
<Deterministic>true</Deterministic> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>full</DebugType> |
||||
<Optimize>false</Optimize> |
||||
<OutputPath>bin\Debug\</OutputPath> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<ErrorReport>prompt</ErrorReport> |
||||
<WarningLevel>4</WarningLevel> |
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<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.Core" /> |
||||
<Reference Include="System.Xml.Linq" /> |
||||
<Reference Include="System.Data.DataSetExtensions" /> |
||||
<Reference Include="Microsoft.CSharp" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Deployment" /> |
||||
<Reference Include="System.Drawing" /> |
||||
<Reference Include="System.Net.Http" /> |
||||
<Reference Include="System.Windows.Forms" /> |
||||
<Reference Include="System.Xml" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="data.cs" /> |
||||
<Compile Include="Form1.cs"> |
||||
<SubType>Form</SubType> |
||||
</Compile> |
||||
<Compile Include="Form1.Designer.cs"> |
||||
<DependentUpon>Form1.cs</DependentUpon> |
||||
</Compile> |
||||
<Compile Include="Program.cs" /> |
||||
<Compile Include="Properties\AssemblyInfo.cs" /> |
||||
<Compile Include="search.cs"> |
||||
<SubType>Form</SubType> |
||||
</Compile> |
||||
<Compile Include="search.Designer.cs"> |
||||
<DependentUpon>search.cs</DependentUpon> |
||||
</Compile> |
||||
<Compile Include="UnsafeBitmap.cs" /> |
||||
<EmbeddedResource Include="Form1.resx"> |
||||
<DependentUpon>Form1.cs</DependentUpon> |
||||
</EmbeddedResource> |
||||
<EmbeddedResource Include="Properties\Resources.resx"> |
||||
<Generator>ResXFileCodeGenerator</Generator> |
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput> |
||||
<SubType>Designer</SubType> |
||||
</EmbeddedResource> |
||||
<Compile Include="Properties\Resources.Designer.cs"> |
||||
<AutoGen>True</AutoGen> |
||||
<DependentUpon>Resources.resx</DependentUpon> |
||||
<DesignTime>True</DesignTime> |
||||
</Compile> |
||||
<EmbeddedResource Include="search.resx"> |
||||
<DependentUpon>search.cs</DependentUpon> |
||||
</EmbeddedResource> |
||||
<None Include="Properties\Settings.settings"> |
||||
<Generator>SettingsSingleFileGenerator</Generator> |
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput> |
||||
</None> |
||||
<Compile Include="Properties\Settings.Designer.cs"> |
||||
<AutoGen>True</AutoGen> |
||||
<DependentUpon>Settings.settings</DependentUpon> |
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput> |
||||
</Compile> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="App.config" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="Resources\t1-320x256.bmp" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="Resources\olo_02.bmp" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="Resources\olo_03.bmp" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="Resources\i1.png" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="Resources\CheckBoxChecked.png" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="Resources\CheckBoxUnchecked.png" /> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
||||
</Project> |
||||
@ -0,0 +1,92 @@
@@ -0,0 +1,92 @@
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Drawing.Imaging; |
||||
|
||||
namespace UTIL |
||||
{ |
||||
public unsafe class UnsafeBitmap |
||||
{ |
||||
Bitmap bitmap; |
||||
// three elements used for MakeGreyUnsafe |
||||
int width; |
||||
BitmapData bitmapData = null; |
||||
Byte* pBase = null; |
||||
public UnsafeBitmap(Bitmap bitmap) |
||||
{ |
||||
this.bitmap = new Bitmap(bitmap); |
||||
} |
||||
public UnsafeBitmap(int width, int height) |
||||
{ |
||||
this.bitmap = new Bitmap(width, height, PixelFormat.Format24bppRgb); |
||||
} |
||||
public void Dispose() |
||||
{ |
||||
bitmap.Dispose(); |
||||
} |
||||
public Bitmap Bitmap |
||||
{ |
||||
get |
||||
{ |
||||
return (bitmap); |
||||
} |
||||
} |
||||
private Point PixelSize |
||||
{ |
||||
get |
||||
{ |
||||
GraphicsUnit unit = GraphicsUnit.Pixel; |
||||
RectangleF bounds = bitmap.GetBounds(ref unit); |
||||
|
||||
return new Point((int)bounds.Width, (int)bounds.Height); |
||||
} |
||||
} |
||||
public void LockBitmap() |
||||
{ |
||||
GraphicsUnit unit = GraphicsUnit.Pixel; |
||||
RectangleF boundsF = bitmap.GetBounds(ref unit); |
||||
Rectangle bounds = new Rectangle((int)boundsF.X, |
||||
(int)boundsF.Y, |
||||
(int)boundsF.Width, |
||||
(int)boundsF.Height); |
||||
|
||||
// Figure out the number of bytes in a row |
||||
// This is rounded up to be a multiple of 4 |
||||
// bytes, since a scan line in an image must always be a multiple of 4 bytes |
||||
// in length. |
||||
width = (int)boundsF.Width * sizeof(PixelData); |
||||
if (width % 4 != 0) |
||||
{ |
||||
width = 4 * (width / 4 + 1); |
||||
} |
||||
bitmapData = |
||||
bitmap.LockBits(bounds, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb); |
||||
pBase = (Byte*)bitmapData.Scan0.ToPointer(); |
||||
} |
||||
public PixelData GetPixel(int x, int y) |
||||
{ |
||||
PixelData returnValue = *PixelAt(x, y); |
||||
return returnValue; |
||||
} |
||||
public void SetPixel(int x, int y, PixelData colour) |
||||
{ |
||||
PixelData* pixel = PixelAt(x, y); |
||||
*pixel = colour; |
||||
} |
||||
public void UnlockBitmap() |
||||
{ |
||||
bitmap.UnlockBits(bitmapData); |
||||
bitmapData = null; |
||||
pBase = null; |
||||
} |
||||
public PixelData* PixelAt(int x, int y) |
||||
{ |
||||
return (PixelData*)(pBase + y * width + x * sizeof(PixelData)); |
||||
} |
||||
} |
||||
public struct PixelData |
||||
{ |
||||
public byte blue; |
||||
public byte green; |
||||
public byte red; |
||||
} |
||||
} |
||||
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Text; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace Test_img |
||||
{ |
||||
public class DData |
||||
{ |
||||
} |
||||
public static class StaticData |
||||
{ |
||||
public delegate void ValueChangedEventHandler(object sender, EventArgs e); |
||||
public static event ValueChangedEventHandler ValueChanged; |
||||
|
||||
public delegate void FonEventHandler(UInt32 fon); |
||||
public static FonEventHandler Fon; |
||||
|
||||
public delegate void TrgHandler(); |
||||
public static event TrgHandler TrgEventHandler; |
||||
|
||||
public delegate void SHandler(); |
||||
public static SHandler SHandlerSearch; |
||||
|
||||
private static int dataBuffer = 0; |
||||
public static void Trg() |
||||
{ |
||||
TrgEventHandler?.Invoke(); |
||||
} |
||||
public static int DataBuffer |
||||
{ |
||||
get |
||||
{ |
||||
return dataBuffer; |
||||
} |
||||
set |
||||
{ |
||||
dataBuffer = value; |
||||
ValueChanged(null, EventArgs.Empty); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,85 @@
@@ -0,0 +1,85 @@
|
||||
namespace Test_img |
||||
{ |
||||
partial class search |
||||
{ |
||||
/// <summary> |
||||
/// Required designer variable. |
||||
/// </summary> |
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary> |
||||
/// Clean up any resources being used. |
||||
/// </summary> |
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing && (components != null)) |
||||
{ |
||||
components.Dispose(); |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
#region Windows Form Designer generated code |
||||
|
||||
/// <summary> |
||||
/// Required method for Designer support - do not modify |
||||
/// the contents of this method with the code editor. |
||||
/// </summary> |
||||
private void InitializeComponent() |
||||
{ |
||||
this.trackBar1 = new System.Windows.Forms.TrackBar(); |
||||
this.label1 = new System.Windows.Forms.Label(); |
||||
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); |
||||
this.SuspendLayout(); |
||||
// |
||||
// trackBar1 |
||||
// |
||||
this.trackBar1.AutoSize = false; |
||||
this.trackBar1.Location = new System.Drawing.Point(13, 4); |
||||
this.trackBar1.Maximum = 255; |
||||
this.trackBar1.Name = "trackBar1"; |
||||
this.trackBar1.Size = new System.Drawing.Size(310, 33); |
||||
this.trackBar1.TabIndex = 0; |
||||
this.trackBar1.TickFrequency = 10; |
||||
this.trackBar1.Value = 200; |
||||
this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll); |
||||
// |
||||
// label1 |
||||
// |
||||
this.label1.AutoSize = true; |
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); |
||||
this.label1.Location = new System.Drawing.Point(329, 12); |
||||
this.label1.Name = "label1"; |
||||
this.label1.Size = new System.Drawing.Size(31, 16); |
||||
this.label1.TabIndex = 1; |
||||
this.label1.Text = "200"; |
||||
// |
||||
// search |
||||
// |
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
||||
this.ClientSize = new System.Drawing.Size(368, 40); |
||||
this.ControlBox = false; |
||||
this.Controls.Add(this.label1); |
||||
this.Controls.Add(this.trackBar1); |
||||
this.DoubleBuffered = true; |
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; |
||||
this.MaximizeBox = false; |
||||
this.MinimizeBox = false; |
||||
this.Name = "search"; |
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; |
||||
this.Text = "search"; |
||||
this.Load += new System.EventHandler(this.search_Load); |
||||
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); |
||||
this.ResumeLayout(false); |
||||
this.PerformLayout(); |
||||
|
||||
} |
||||
|
||||
#endregion |
||||
|
||||
private System.Windows.Forms.TrackBar trackBar1; |
||||
private System.Windows.Forms.Label label1; |
||||
} |
||||
} |
||||
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace Test_img |
||||
{ |
||||
public partial class search : Form |
||||
{ |
||||
public search() |
||||
{ |
||||
InitializeComponent(); |
||||
} |
||||
|
||||
private void trackBar1_Scroll(object sender, EventArgs e) |
||||
{ |
||||
label1.Text = trackBar1.Value.ToString(); |
||||
StaticData.DataBuffer = trackBar1.Value; |
||||
} |
||||
|
||||
private void button1_Click(object sender, EventArgs e) |
||||
{ |
||||
//StaticData.Start = ""; |
||||
//StaticData.SHandlerSearch?.Invoke(); |
||||
//StaticData.Trg(); |
||||
// StaticData.SHandlerSearch += true; |
||||
} |
||||
|
||||
private void search_Load(object sender, EventArgs e) |
||||
{ |
||||
StaticData.Fon = new StaticData.FonEventHandler(newfon); |
||||
|
||||
//StaticData.Fon += (ee) => |
||||
//{ |
||||
// trackBar1.Value = (int)ee + 5; |
||||
// label1.Text = (int)ee + 5.ToString(); |
||||
//}; |
||||
|
||||
} |
||||
private void newfon(UInt32 ee) |
||||
{ |
||||
trackBar1.Minimum = (int)ee; |
||||
trackBar1.Value = (int)ee + 1; |
||||
label1.Text = ((int)ee + 1).ToString(); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,120 @@
@@ -0,0 +1,120 @@
|
||||
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<resheader name="writer"> |
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
</root> |
||||
|
After Width: | Height: | Size: 180 B |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 239 KiB |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00 |
||||
# Visual Studio 2013 |
||||
VisualStudioVersion = 12.0.21005.1 |
||||
MinimumVisualStudioVersion = 10.0.40219.1 |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test_image_processing_1", "test_image_processing_1\test_image_processing_1.csproj", "{5238A504-9522-4F92-82F1-0D7A3C52125A}" |
||||
EndProject |
||||
Global |
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
||||
Debug|Any CPU = Debug|Any CPU |
||||
Release|Any CPU = Release|Any CPU |
||||
EndGlobalSection |
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
||||
{5238A504-9522-4F92-82F1-0D7A3C52125A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{5238A504-9522-4F92-82F1-0D7A3C52125A}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{5238A504-9522-4F92-82F1-0D7A3C52125A}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{5238A504-9522-4F92-82F1-0D7A3C52125A}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
EndGlobalSection |
||||
GlobalSection(SolutionProperties) = preSolution |
||||
HideSolutionNode = FALSE |
||||
EndGlobalSection |
||||
EndGlobal |
||||
@ -0,0 +1,118 @@
@@ -0,0 +1,118 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Text; |
||||
using System.Windows.Forms; |
||||
|
||||
|
||||
namespace test_image_processing_1 |
||||
{ |
||||
public class cnst |
||||
{ |
||||
public const ushort BAD_PIXELS_ARRAY_SIZE = 256; |
||||
public const ushort SN_LENGTH = 128; |
||||
public const ushort NO_MARKER = 0; // 'no marker' cluster identifier |
||||
public const ushort REASON_BY_REQUEST = 0x0; // output status message initiated by host request |
||||
public const ushort REASON_BY_TIMER = 0x1; // output status message initiated by timer event |
||||
public const ushort REASON_BY_STATE = 0x2; // output status message initiated by state change |
||||
|
||||
public const ushort MODE_OPERATIONAL = 0x1; // normal mode |
||||
public const ushort MODE_PROGRAMMING = 0x2; // device is being programmed |
||||
} |
||||
class Program |
||||
{ |
||||
public struct FIFO_ITEM |
||||
{ |
||||
public ushort x; |
||||
public ushort y; |
||||
} |
||||
|
||||
//public struct BAD_PIX_FILE_STRUCTURE |
||||
//{ |
||||
// public ushort count; |
||||
// public fixed FIFO_ITEM array[256]; |
||||
//} |
||||
|
||||
unsafe public struct CONFIG_FILE_STRUCTURE |
||||
{ |
||||
public fixed byte szSerialNumber[128];// matrix serial number, zero-terminated string |
||||
public ushort nXc, nYc; // centers of matrices, pix |
||||
public ushort nRs, nRb; // lens field of view radius ('s'=small, 'b'=big), pix |
||||
public byte cLc; // neighbour distance for clasters, pix |
||||
public ushort nLimit; // FIFO limit (10-bit) |
||||
public ushort nVinb, nVref; // VINB & VREF (10-bit) |
||||
public float fA, fB, fC; // Fi=A*x^2 + Bx + C |
||||
} |
||||
unsafe public struct THE_POINT |
||||
{ |
||||
public FIFO_ITEM *pi; |
||||
public byte *pm; |
||||
} |
||||
public struct CLUSTER_COORD |
||||
{ |
||||
public ushort count; // number of points (pixels) in cluster |
||||
public byte excluded; // flag, cluster should be ignored if TRUE |
||||
public byte marker; // cluster identicator |
||||
public ARM_RECT rect; // rectangular area of cluster (in pixels) |
||||
} |
||||
public struct ARM_RECT |
||||
{ |
||||
public ushort left; |
||||
public ushort top; |
||||
public ushort right; |
||||
public ushort bottom; |
||||
} |
||||
unsafe void CopyRect(ARM_RECT *dst, ARM_RECT *src) |
||||
{ |
||||
dst->left = src->left; |
||||
dst->top = src->top; |
||||
dst->right = src->right; |
||||
dst->bottom = src->bottom; |
||||
} |
||||
unsafe bool EmptyRect(ARM_RECT *r) |
||||
{ |
||||
return !(((int)r->right - (int)r->left) > 0 && |
||||
((int)r->bottom - (int)r->top) > 0); |
||||
} |
||||
unsafe bool IntersectRect(ARM_RECT *r, ARM_RECT *r1, ARM_RECT *r2) |
||||
{ |
||||
ARM_RECT rect; |
||||
CopyRect(&rect, r1); |
||||
if(r2->left > r1->left ) rect.left = r2->left; |
||||
if(r2->top > r1->top ) rect.top = r2->top; |
||||
if(r2->right < r1->right ) rect.right = r2->right; |
||||
if(r2->bottom < r1->bottom) rect.bottom = r2->bottom; |
||||
if(r != null) |
||||
*r = rect; |
||||
return !EmptyRect(&rect); |
||||
} |
||||
unsafe void make_point(FIFO_ITEM *pi, byte *pm, THE_POINT *point) |
||||
{ |
||||
point->pi = pi; |
||||
point->pm = pm; |
||||
} |
||||
unsafe bool neighbour_points(THE_POINT *p1, THE_POINT *p2, byte length) |
||||
{ |
||||
return (Math.Abs((short)p2->pi->x - (short)p1->pi->x) <= length) && |
||||
(Math.Abs((short)p2->pi->y - (short)p1->pi->y) <= length); |
||||
} |
||||
unsafe bool point_has_no_marker(THE_POINT *p) |
||||
{ |
||||
return *(p->pm) == cnst.NO_MARKER; |
||||
} |
||||
unsafe void copy_marker(THE_POINT *dst, THE_POINT *src) |
||||
{ |
||||
*(dst->pm) = *(src->pm); |
||||
} |
||||
public struct COORDS_DATA |
||||
{ |
||||
uint time; // time of alarm, in 10us units |
||||
short angle1; // |
||||
short angle2; // |
||||
} |
||||
|
||||
static void Main(string[] args) |
||||
{ |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
// Управление общими сведениями о сборке осуществляется с помощью |
||||
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, |
||||
// связанные со сборкой. |
||||
[assembly: AssemblyTitle("test_image_processing_1")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("test_image_processing_1")] |
||||
[assembly: AssemblyCopyright("Copyright © 2017")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// Параметр ComVisible со значением FALSE делает типы в сборке невидимыми |
||||
// для COM-компонентов. Если требуется обратиться к типу в этой сборке через |
||||
// COM, задайте атрибуту ComVisible значение TRUE для этого типа. |
||||
[assembly: ComVisible(false)] |
||||
|
||||
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM |
||||
[assembly: Guid("b51ddaea-c0e5-43af-a807-e43e87a7df42")] |
||||
|
||||
// Сведения о версии сборки состоят из следующих четырех значений: |
||||
// |
||||
// Основной номер версии |
||||
// Дополнительный номер версии |
||||
// Номер сборки |
||||
// Редакция |
||||
// |
||||
// Можно задать все значения или принять номера сборки и редакции по умолчанию |
||||
// используя "*", как показано ниже: |
||||
// [assembly: AssemblyVersion("1.0.*")] |
||||
[assembly: AssemblyVersion("1.0.0.0")] |
||||
[assembly: AssemblyFileVersion("1.0.0.0")] |
||||
@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
||||
<PropertyGroup> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProjectGuid>{5238A504-9522-4F92-82F1-0D7A3C52125A}</ProjectGuid> |
||||
<OutputType>Exe</OutputType> |
||||
<AppDesignerFolder>Properties</AppDesignerFolder> |
||||
<RootNamespace>test_image_processing_1</RootNamespace> |
||||
<AssemblyName>test_image_processing_1</AssemblyName> |
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
||||
<FileAlignment>512</FileAlignment> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>full</DebugType> |
||||
<Optimize>false</Optimize> |
||||
<OutputPath>bin\Debug\</OutputPath> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<ErrorReport>prompt</ErrorReport> |
||||
<WarningLevel>4</WarningLevel> |
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<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.Core" /> |
||||
<Reference Include="System.Windows.Forms" /> |
||||
<Reference Include="System.Xml.Linq" /> |
||||
<Reference Include="System.Data.DataSetExtensions" /> |
||||
<Reference Include="Microsoft.CSharp" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Xml" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="Program.cs" /> |
||||
<Compile Include="Properties\AssemblyInfo.cs" /> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildToolsPath)\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> |
||||
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 240 KiB |