LEADTOOLS(Leadtoolsアセンブリ)

フレームを表示

RasterSupportクラス








メンバ 
LEADTOOLS Document/Medical能力などの、RasterSupportクラスは、メソッドをLEADTOOLS配布ライセンスを設定して、オプションのLEADTOOLS機能のサポートをロック解除するために提供します。サーバーライセンスをアクティベーションするために、アクティベーションサーバーライセンスを参照します。
オブジェクトモデル
構文
public static class RasterSupport 
'Declaration
 
Public MustInherit NotInheritable Class RasterSupport 
'Usage
 
Dim instance As RasterSupport
public sealed static class RasterSupport 
interface LTRasterSupport : NSObject
public final class RasterSupport 
function Leadtools.RasterSupport()
public ref class RasterSupport abstract sealed 
解説
詳細については、「特殊なLEAD機能のアンロック」を参照してください。
サンプル

このサンプルは配布ライセンスを設定して、ドキュメントサポートを調べます。

Copy Code ?
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing

Dim MY_LICENSE_FILE As String = "d:\\temp\\TestLic.lic"
Dim MY_DEVELOPER_KEY As String = "xyz123abc"
<TestMethod> _
Public Sub SetLicenseFileExample()
   RasterSupport.SetLicense(MY_LICENSE_FILE, MY_DEVELOPER_KEY)
   Dim isLocked As Boolean = RasterSupport.IsLocked(RasterSupportType.Document)
   If (isLocked) Then
      Console.WriteLine("Document support is locked")
   Else
      Console.WriteLine("Document support is unlocked")
   End If
End Sub
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;

string MY_LICENSE_FILE = @"d:\temp\TestLic.lic";
string MY_DEVELOPER_KEY = "xyz123abc";
[TestMethod]
public void SetLicenseFileExample()
{
   RasterSupport.SetLicense(MY_LICENSE_FILE, MY_DEVELOPER_KEY);
   bool isLocked = RasterSupport.IsLocked(RasterSupportType.Document);
   if(isLocked)
      Console.WriteLine("Document support is locked");
   else
      Console.WriteLine("Document support is unlocked");
}
RasterSupportExamples.prototype.SetLicenseFileExample = function ( ) 
{
    var MY_LICENSE_FILE = "All_v2.lic";
    var MY_DEVELOPER_KEY = "";

    Leadtools.RasterSupport.setLicense("Assets\\" + MY_LICENSE_FILE, MY_DEVELOPER_KEY);

    var isLocked = Leadtools.RasterSupport.isLocked(Leadtools.RasterSupportType.document);
    if(isLocked)
        console.info("Document support is locked");
    else
        console.info("Document support is unlocked");
    console.assert(!isLocked, "!isLocked");
}
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;

[TestMethod]
public void SetLicenseExample()
{
   var getFileAsync = Tools.AppInstallFolder.GetFileAsync(@"Assets\" + MY_LICENSE_FILE);
   getFileAsync.Completed = delegate(IAsyncOperation<StorageFile> getFileAsyncResult, AsyncStatus getFileAsyncStatus)
   {
      StorageFile licStorageFile = getFileAsyncResult.GetResults();
      var openAsync = licStorageFile.OpenAsync(FileAccessMode.Read);
      openAsync.Completed = delegate(IAsyncOperation<IRandomAccessStream> openAsyncResult, AsyncStatus openAsyncStatus)
      {
         IRandomAccessStream licStream = openAsyncResult.GetResults();
         RasterSupport.SetLicense(licStream, MY_DEVELOPER_KEY);
         bool isLocked = RasterSupport.IsLocked(RasterSupportType.Document);
         if(isLocked)
            Debug.WriteLine("Document support is locked");
         else
            Debug.WriteLine("Document support is unlocked");
         Assert.IsTrue(!isLocked);
      };
   };
}
using Leadtools;
using Leadtools.ImageProcessing;

internal static Uri GetPackResourceUri(string resourcePath)
{
   System.Reflection.Assembly a = System.Reflection.Assembly.GetCallingAssembly();

   // Pull out the short name.
   string assemblyShortName = a.ToString().Split(',')[0];

   string uriString = "/" + assemblyShortName + ";component/" + resourcePath;
   return new Uri(uriString, UriKind.Relative);
}


public void UnlockDocumentSupportExample()
{
   //The license file should be added as a Resource to your project.
   System.Windows.Resources.StreamResourceInfo licenseInfo = Application.GetResourceStream(GetPackResourceUri("Resources/License.lic"));
   string developerKey = "xyz123abc";
   RasterSupport.SetLicense(licenseInfo.Stream, developerKey);

   // Check if the support is locked now
   bool isLocked = RasterSupport.IsLocked(RasterSupportType.Document);
   if(isLocked)
      Console.WriteLine("Document support is locked");
   else
      Console.WriteLine("Document support is unlocked");
}
Imports Leadtools
Imports Leadtools.ImageProcessing

Friend Shared Function GetPackResourceUri(ByVal resourcePath As String) As Uri
  Dim a As System.Reflection.Assembly = System.Reflection.Assembly.GetCallingAssembly()

  ' Pull out the short name.
  Dim assemblyShortName As String = a.ToString().Split(","c)(0)

  Dim uriString As String = "/" & assemblyShortName & ";component/" & resourcePath
  Return New Uri(uriString, UriKind.Relative)
End Function


 <TestMethod()> _
Public Sub UnlockDocumentSupportExample()
  'The license file should be added as a Resource to your project.
  Dim licenseInfo As System.Windows.Resources.StreamResourceInfo = Application.GetResourceStream(GetPackResourceUri("Resources/License.lic"))
  Dim developerKey As String = "xyz123abc"
  RasterSupport.SetLicense(licenseInfo.Stream, developerKey)

  ' Check if the support is locked now
  Dim isLocked As Boolean = RasterSupport.IsLocked(RasterSupportType.Document)
  If isLocked Then
    Console.WriteLine("Document support is locked")
  Else
    Console.WriteLine("Document support is unlocked")
  End If
End Sub
必要条件

ターゲットプラットホーム

参照

参照

RasterSupportメンバ
Leadtools名前空間
アクティベーションサーバーライセンス