PDA

View Full Version : Using Aspjpeg in C#.Net 3.5 app


mm2000
08-15-2008, 05:29 AM
Hi,

Is it possible to use Persits Aspjpeg in C#.Net 3.5? If so, could you please reply with C# code that can use this component?

I used the following code and when I try to load the page I got the error message 'Compiler Error Message: CS0246: The type or namespace name 'ASPJPEGLib' could not be found (are you missing a using directive or an assembly reference?)'.

My Code:

protected void Generate_From_Component()
{

string ImagePath = '../Images/test.jpg';

ASPJPEGLib.IASPJpeg Jpeg = new ASPJPEGLib.ASPJpeg();

...........................
}

Thanks!!

PS: I also tried adding the 'using ASPJPEGLib;' in code behind file at the top and got the namespace reference error message (same as above).

Any help will be appreciated!!

bruce
08-15-2008, 06:14 AM
Since aspjpeg is a COM object, you'll need to use a InterOp. I have not tested it but it may work.


You should really consider using ASP.NET component rather than accessing a COM object w/ .NET.


Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

mm2000
08-15-2008, 07:21 AM
Thanks for the reply Bruce. Few questions on that:

// Since aspjpeg is a COM object, you'll need to use a InterOp. I have not tested it but it may work.

I am not sure what you mean by 'InterOp'? Do you mean change <@Page aspcompat='true' %>. That did not seem to work either.


// You should really consider using ASP.NET component rather than accessing a COM object w/ .NET.

I would also prefer to use .Net component instead of COM object. Which one would you recommend (and is it offered by DASP)? I primarily want to resize uploaded images and found aspjpeg (offered by DASP) to be the best option.

Any help (and maybe code) in using a .NET component to resize image would be greatly appreciated.

Thanks a lot!! http://community.discountasp.net/emoticons/smile.gif

mm2000
08-15-2008, 07:26 AM
The nearest match I found is in this URL:

translate.google.com/translate?hl=en&sl=pt&u=http://www.webmastersonline.com.br/viewtopic.php%3Ff%3D6%26t%3D489&sa=X&oi=translate&resnum=4&ct=result&prev=/search%3Fq%3DImport%2BNamespace%253D%2522ASPJPEGLi b%2522%26num%3D20%26hl%3Den%26newwindow%3D1%26safe %3Doff%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26hs%3DOa5 (http://translate.google.com/translate?hl=en&sl=pt&u=http://www.webmastersonline.com.br/viewtopic.php%3Ff%3D6%26t%3D489&sa=X&oi=translate&resnum=4&ct=result&prev=/search%3Fq%3DImport%2BNamespace%253D%2522ASPJPEGLi b%2522%26num%3D20%26hl%3Den%26newwindow%3D1%26safe %3Doff%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26hs%3DOa5)

but it gives the namespace error message.

I also added aspjpeg.dll to /Bin directory but still get the namespace error message.

bruce
08-15-2008, 09:37 AM
InterOp is sort of like a wrapper class for COM object.


For ASP.NET, you can handle graphic resizing by using native .NET classes. See following articles


http://aspnet.4guysfromrolla.com/articles/012203-1.aspx


http://www.neodynamic.com/ND/FaqsTipsTricks.aspx?tabid=66&amp;prodid=4&amp;sid=71


Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

mm2000
08-21-2008, 05:01 AM
Thanks for your help Bruce /emoticons/smile.gif