Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Andrew  
#1 Posted : Sunday, November 30, 2003 5:01:00 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Hello everybody,

As you know, COM components can be used in any .NET application (including ASP.NET pages). Here I would like to give you a starting point how to work with Graphics Mill in ASP.NET.

First of all, when you work in ASP.NET you can use COM components in two modes: with early binding (like in common Windows apps) and late binding (like in classic ASP). Using late binding is easier (you work with the component like in ASP - create objects with Server.CreateObject, nothing is necessary to be imported). However using early binding is much better due performance reasons and because it allows to find a lot of coding errors on compile time.

Let's examine how to work with Graphics Mill using early binding. Follow these steps:

1. First of all, you should generate a wrapper dll to be able to use Graphics Mill in ASP.NET. You can do it using utility tlbimp.exe (it is supplied with .NET Framework).

2. Tlbimp will generate GraphicsMill.dll file. Put this dll into /bin folder of your web application.

3. After this you can use Graphics Mill classes as common .NET classes. Here is a code sample which resizes bitmap with high quality:

Code:

<%@ Page Language="VB" %>
<%@ import Namespace="GraphicsMill" %>
<%
Dim objBitmap As New Bitmap
objBitmap.LoadFromFile(Server.MapPath("default.jpg"))
 
objBitmap.Transforms.Resize (800, ,InterpolationMode.InterpolationModeHighQuality)
Response.ContentType = objBitmap.Formats.Current.MimeType
Response.BinaryWrite(objBitmap.SaveToMemory())
%>


Draw attention, how I send the image to the Response. As ASP.NET Response object is incompatible with ASP Response (so we cannot retrieve image through the stream), we should save it to an array first and then send this array to the Response. In this case Graphics Mill cannot specify content type automatically, so we should do it ourselves. MimeType property returns the content type of currently selected format, so you should not remember what exact content type to specify...

More information about using COM components in ASP.NET you can get in MSDN. If something is unclear, feel free to write to forum or submit case).

Edited by user Friday, May 23, 2008 4:25:53 PM(UTC)  | Reason: Not specified

photo_tom  
#2 Posted : Friday, December 26, 2003 11:31:00 PM(UTC)
photo_tom

Rank: Member

Groups: Member
Joined: 11/27/2003(UTC)
Posts: 29

I'm a little confused because I now see two differnet ways on this site to do this.

Fedor as a great discussion in http://www.aurigma.com/S...fSupport%2fSupport.aspx, but links to download go to pages without any download links.

Then there is this methoed.

Which should I be using?
Tom Thorp
Still waters, great photos
Fedor  
#3 Posted : Friday, December 26, 2003 11:42:00 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Support section on web-site is frame-based. So this link:

http://www.aurigma.com/S...2fSupport%2fSupport.aspx

is just top page.

Could you give me link to the frame with posts or at least say subject of topic.

Thanks.
Best regards,
Fedor Skvortsov
photo_tom  
#4 Posted : Saturday, December 27, 2003 12:46:00 AM(UTC)
photo_tom

Rank: Member

Groups: Member
Joined: 11/27/2003(UTC)
Posts: 29

Page titiled:

Aurigma COM to .NET
No ActiveX Server Registration Needed with ASP.NET

In the support section. Discussion looks excellant, but links do not lead to anything that can be downloaded, only a further description for com-asp.net
Tom Thorp
Still waters, great photos
Fedor  
#5 Posted : Sunday, December 28, 2003 7:28:00 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Hello Tom,

I recommend you to use approach which is discussed in this post.

As for running Graphics Mill ActiveX component without registration we will try to use alternative way using manifest and Side-By-Side assemblies. I will post my results here soon.
Best regards,
Fedor Skvortsov
Atreyu  
#6 Posted : Wednesday, January 28, 2004 6:21:00 PM(UTC)
Atreyu

Rank: Member

Groups: Member
Joined: 1/28/2004(UTC)
Posts: 8

I created a wrapper class for GraphcsMill20.dll, but during the creationI got a bunch of warnings informing me that some arguments for some methods (see below).

It also generated not one, but two dlls. These two dll's (GraphicsMill.dll and stdole.dll). These two dll's contain two respective namespaces : GraphicsMill (with a lot of classes regarding image processing) and stdole (regarding some picture and font classes)

Are there any options I'm forgetting for creating the wrapper class? Is it better to use the Com to .Net program, and if so, wher can I obtain this?

I would be nice if the wrapper class dll would already be supplied with the component itself.

warnings:
Code:
TlbImp warning: The type library importer could not convert the signature for the member 'DISPPARAMS.rgvarg'.
TlbImp warning: The type library importer could not convert the signature for the member 'DISPPARAMS.rgdispidNamedArgs'.
TlbImp warning: The type library importer could not convert the signature for the member 'EXCEPINFO.pvReserved'.
TlbImp warning: The type library importer could not convert the signature for the member 'EXCEPINFO.pfnDeferredFillIn'.
TlbImp warning: At least one of the arguments for 'IPicture.Render' can not be marshaled by the runtime marshaler.
  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
TlbImp warning: At least one of the arguments for 'IPicture.SaveAsFile' can not be marshaled by the runtime marshaler.
  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
TlbImp warning: At least one of the arguments for 'Picture.Render' can not be marshaled by the runtime marshaler.
  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
TlbImp warning: At least one of the arguments for 'IPictureDisp.Render' can not be marshaled by the runtime marshaler.
  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
TlbImp warning: At least one of the arguments for 'StdPicture.Render' can not be marshaled by the runtime marshaler.
  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
TlbImp warning: At least one of the arguments for 'StdPicture.Render' can not be marshaled by the runtime marshaler.
  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
TlbImp warning: At least one of the arguments for 'StdPicture.SaveAsFile' can not be marshaled by the runtime marshaler.
  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Type library imported to GraphicsMill.dll

Fedor  
#7 Posted : Wednesday, January 28, 2004 11:33:00 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Hello,

I created a wrapper class for GraphcsMill20.dll, but during the creationI got a bunch of warnings informing me that some arguments for some methods (see below).

It also generated not one, but two dlls. These two dll's (GraphicsMill.dll and stdole.dll). These two dll's contain two respective namespaces : GraphicsMill (with a lot of classes regarding image processing) and stdole (regarding some picture and font classes)


I tried to create assembly from command line following way:

Code:
TlbImp GraphicsMill20.dll /out:GraphicsMill20.Interop.dll /namespace:Aurigma.GraphicsMill


In fact it generated one GraphicsMill20.Interop.dll assembly and havn't received any error. Could say what way have you created interop assembly?

Are there any options I'm forgetting for creating the wrapper class? Is it better to use the Com to .Net program, and if so, wher can I obtain this?

I think it is better to use standard TlbImp.exe util in this case.

I would be nice if the wrapper class dll would already be supplied with the component itself.

It is good proposal. We will include wrapper assembly in next Graphics Mill update. Now you can download wrapper assembly for Graphics Mill 2.0.325.0 here:

GraphicsMill.Interop.zip (37kb)

EDITED: .NET assemblies are included in package with Graphics Mill version 2.0.337.0 an higher. You can find them in Binaries for .NET subfolder of folder where Graphics Mill was installed.

Best regards,
Fedor Skvortsov
Atreyu  
#8 Posted : Thursday, January 29, 2004 12:24:00 AM(UTC)
Atreyu

Rank: Member

Groups: Member
Joined: 1/28/2004(UTC)
Posts: 8

Great, thanks for your reply and making the .dll available!

I adjusted your command, and maybe mine produced errors because I didn't specify what namespace to create.

I'll start using it tomorrow!
Fedor  
#9 Posted : Sunday, January 2, 2005 9:56:00 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
We have released Aurigma Graphics Mill for .NET which is native .NET component.

Graphics Mill for .NET includes classes for image processing, as well as set of convinient ASP.NET Web Controls.
Best regards,
Fedor Skvortsov
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.