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(); } } }