Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 736
Product
ImgWriter
Title
How do I use ImgWriter in an ASP.NET application?
Solution

ImgWriter is implemented in an ASP.NET application just as you might with any other COM component:

  • The COM dll needs to be properly registered on the webserver.
  • The COM type library needs to be wrapped in an interop assembly.
  • This interop assembly needs to be placed in either the application's bin (or GAC) directory.
Microsoft Visual Studio .NET can create the interop assembly and place it in the application's bin directory for you, when you choose to add that COM component as a reference.

The instructions below assume Visual Studio .NET as your development environment. If you are not using Visual Studio .NET and would like to explore other options for creating an interop assembly, please see the .NET Framework SDK Documentation on this subject: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconimportingtypelibraryasassembly.asp Once the interop assembly is created, be sure to place it in either the bin or GAC directory and skip step 2 in the instructions below.

  1. Install ImgWriter on the webserver. For instructions for manual and automated installation, please see: http://support.softartisans.com/Imgwriter/default.asp

  2. In Visual Studio .NET, add a reference to your application to the "SAImageCollection 1.0 Type Library" and the "SAImageGen 1.0 Type Library". (Project... Add Reference..."Com" tab).

  3. Instantiate ImgWriter in your code: Dim oImgColl As New SAIMAGECOLLECTIONLib.Images()
    ...
    Dim oImgGen As New SAIMAGEGENLib.ImageGen()

  4. Access the methods and properties of ImgWriter in the usual way: Response.Write(oImgColl.Count)
    ...
    oImgGen.BufferResponse = True

For specific information on streaming the image to the browser in a .NET environment, please see the following KB article: http://support.softartisans.com/kbview.aspx?ID=639

Created : 9/15/2003 11:29:08 AM (last modified : 1/27/2004 9:44:33 AM)
Rate this article!
Comments