using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Drawing;
using System.Drawing.Imaging;
using System.Diagnostics;
namespace ConsoleApplication1
{
class Program
{
[DllImport("dll_pack.dll")]
private static extern double DLL_Add(double x, double y);
[DllImport("dll_pack.dll")]
static extern void test(IntPtr p, int x, int y);
static void Main(string[] args)
{
//System.Console.WriteLine(DLL_Add(2.3,2.3));
System.Console.WriteLine(DLL_Add(2.3, 1));
Bitmap b = new Bitmap(@"C://SOP5_10.5mm_25mm_5+5.bmp", true);
BitmapData d = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed);
test(d.Scan0, d.Width, d.Height);
b.UnlockBits(d);
System.Console.ReadLine();
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkxpbnE7CnVzaW5nIFN5c3RlbS5UZXh0Owp1c2luZyBTeXN0ZW0uUnVudGltZS5JbnRlcm9wU2VydmljZXM7CnVzaW5nIFN5c3RlbS5EcmF3aW5nOwp1c2luZyBTeXN0ZW0uRHJhd2luZy5JbWFnaW5nOwoKdXNpbmcgU3lzdGVtLkRpYWdub3N0aWNzOwoKbmFtZXNwYWNlIENvbnNvbGVBcHBsaWNhdGlvbjEKewogICAgY2xhc3MgUHJvZ3JhbQogICAgewogICAgICAgIFtEbGxJbXBvcnQoImRsbF9wYWNrLmRsbCIpXQogICAgICAgIHByaXZhdGUgc3RhdGljIGV4dGVybiBkb3VibGUgRExMX0FkZChkb3VibGUgeCwgZG91YmxlIHkpOwogICAgICAgIFtEbGxJbXBvcnQoImRsbF9wYWNrLmRsbCIpXQogICAgICAgIHN0YXRpYyBleHRlcm4gdm9pZCB0ZXN0KEludFB0ciBwLCBpbnQgeCwgaW50IHkpOwoKICAgICAgICBzdGF0aWMgdm9pZCBNYWluKHN0cmluZ1tdIGFyZ3Mp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