Added image conversion parts from commonwin32.

This commit is contained in:
soukoku
2015-02-18 20:02:39 -05:00
parent bcb1ec2382
commit b27a9ba4cc
18 changed files with 552 additions and 38 deletions

View File

@@ -1,36 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace NTwain.Internals
{
/// <summary>
/// The MSG structure in Windows for TWAIN use.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
struct MESSAGE
{
public MESSAGE(IntPtr hwnd, int message, IntPtr wParam, IntPtr lParam)
{
_hwnd = hwnd;
_message = (uint)message;
_wParam = wParam;
_lParam = lParam;
_time = 0;
_x = 0;
_y = 0;
}
IntPtr _hwnd;
uint _message;
IntPtr _wParam;
IntPtr _lParam;
uint _time;
int _x;
int _y;
}
}

View File

@@ -1,34 +0,0 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
namespace NTwain.Internals
{
[SuppressUnmanagedCodeSecurity]
static class UnsafeNativeMethods
{
#region mem stuff for twain 1.x
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalAlloc")]
internal static extern IntPtr WinGlobalAlloc(uint uFlags, UIntPtr dwBytes);
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalFree")]
internal static extern IntPtr WinGlobalFree(IntPtr hMem);
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalLock")]
internal static extern IntPtr WinGlobalLock(IntPtr handle);
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalUnlock")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool WinGlobalUnlock(IntPtr handle);
#endregion
}
static class NativeMethods
{
[DllImport("user32.dll")]
public static extern IntPtr DefWindowProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
}
}

View File

@@ -1,4 +1,5 @@
using NTwain.Data;
using NTwain.Interop;
using System;
using System.ComponentModel;

View File

@@ -1,4 +1,5 @@
using System;
using NTwain.Interop;
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Interop;