Fixed wrong assumption of rented array size and added example of using non system.drawing image lib.

This commit is contained in:
Eugene Wang
2023-04-08 18:38:51 -04:00
parent 29a8031817
commit 2474fbf74d
11 changed files with 101 additions and 43 deletions

View File

@@ -1,4 +1,5 @@
using System;
using NTwain.Data;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -11,8 +12,8 @@ namespace WinFormSample
{
/// <summary>
/// For demoing loading dsm from custom path in case
/// it's not installed on system and can't be placed
/// besides the exe.
/// it's not installed on system and don't want to be
/// placed besides the exe.
/// </summary>
static class DsmLoader
{
@@ -24,7 +25,7 @@ namespace WinFormSample
{
var dll = Path.Combine(
Path.GetDirectoryName(Environment.ProcessPath ?? Assembly.GetExecutingAssembly().Location)!,
"platforms\\TWAINDSM.dll");
$@"runtimes\win-{(TwainPlatform.Is32bit ? "x86" : "x64")}\native\TWAINDSM.dll");
__dllPtr = LoadLibraryW(dll);
}