Search All Forums
Dart Home | PowerWEB Zoom for ASP.NET | Custom Development Reply | PowerWEB Zoom for ASP.NET Topics | Forums   
AuthorForum: PowerWEB Zoom for ASP.NET
Topic: Parameter is Not Valid Error When LoadImage called

From: Tulsa, OK USA
Posts: 3
Member Since: 05/20/08
posted June 13, 2008 11:10 AM

I'm evaluating PowerWeb Zoom before I buy it to see if it will work for use. All images will need to be loaded dynamically based on query results. When the use clicks on the thumbnail I'm opening another page that will have the PowerWeb Zoom control and the larger image. I get a parameter not valid error when I call the LoadImage function. Here is a part of the code that gets the imagestream and tries to load it:

sImagePath = sImagePath.Trim();
string sFileName = "12456.jpg";
        // create an image object, using the filename we just retrieved
        System.Drawing.Image image = System.Drawing.Image.FromFile(sImagePath);

        // make a memory stream to work with the image bytes
        MemoryStream imageStream = new MemoryStream();

        image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Jpeg);

        imageStream.Position = 0;

        // Load the image into the Zoom control
        Zoom1.LoadImage(imageStream, sFileName);

        // ...and set this image as the active image
        Zoom1.SourceImage = sFileName;

Any suggestions?

K M Drake

From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted June 13, 2008 11:52 AM

Hi Jeff,
I just tried your code and it worked for me.

Are you sure the second parameter is "12456.jpg"?
You will see an error if the filename lacks an extension.

Are you sure sImagePath is correct?

Reply | PowerWEB Zoom for ASP.NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX