Login  
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: Zoom control shrinks image dimensions
earniep

From: Tualatin, OR USA
Posts: 14
Member Since: 07/02/08
posted July 8, 2008 4:23 PM

I am populating the zoom control with a series of images.
Though I've set the Height and Width properties to the size of the original image and use ZoomIn(0), the resulting image on the web page is about 20% smaller.
BTW - Using or not using ZoomIn() has no affect.
Please tell me how I can have my images begin with their native dimensions.
Currently, the only thing I can do is make the boundaries of the control bigger, but not the currently displayed image.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 9, 2008 10:10 AM

Hi,
If you call Zoom.ClearTiles before resetting the size of the control, do you still see the problem?

Thanks,
-ken
earniep

From: Tualatin, OR USA
Posts: 14
Member Since: 07/02/08
posted July 9, 2008 12:30 PM

That helped ALOT.

However one issue still remains.
The first image (regardless of which, I used many to be the default),
is displayed and the zoom control has the correct proportions.
However, upon loading the 2nd image, about 10px of height is added.
Also, I ensured that the Zoom.ClearTitle() and the Width & Height are reset when the SourceImage is changed (instead of just in Page_Load() ).
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 10, 2008 9:13 AM

Hi,
I was not able to reproduce this.
Can you give me an example of the image sizes you are using?
Also, what does your snippet for setting the size and image look like?

Thanks,
-ken
earniep

From: Tualatin, OR USA
Posts: 14
Member Since: 07/02/08
posted July 10, 2008 11:14 AM

Hi, thanx.

All the images are 400 x 400.

//HTML - div containing ASP.NET AJAX that also contains the zoom control.
 <div id="img_zoom">
        <asp:ScriptManager ID="ScriptManager2" runat="server" />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
          <ContentTemplate>
            <cc1:Zoom ID="pwz_product" runat="server" />
          </ContentTemplate>
        </asp:UpdatePanel>
      </div>

//C# called from Page_Init(), only on 1st posting.

    pwz_product.ClearTiles();
//photosPaths ArrayList contains paths to the images.
    pwz_product.SourceImage = photosPaths[0].ToString();
    pwz_product.BackColor = System.Drawing.Color.White;
    pwz_product.Height = Unit.Pixel(400);
    pwz_product.Width = Unit.Pixel(400);
    pwz_product.ToolTip = "Test Caption...";
    pwz_product.WaitMessage = "Please wait";
    pwz_product.CssClass = "zoomcontrol";
    pwz_product.CaptionPosition = Dart.PowerWEB.Zoom.DockPosition.Middle;
    pwz_product.EnableMagnifier = false;

//C# code called to change images for all postbacks
    pwz_product.ClearTiles();
    pwz_product.SourceImage = photosPaths[selBtn - 1].ToString();
    pwz_product.Height = Unit.Pixel(400);
    pwz_product.Width = Unit.Pixel(400);

Thanx!
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 10, 2008 12:47 PM

Hi,
Below is the code I tried with success.
Please put together a simple new project and give this a try.
It just uses 2 400x400 images, with the Zoom and a Button.
Assuming this works, see if you can figure out what in your project is contributing to the behavior.
The style sheet?
The postback/callback mechanism?
(I tried with both a standard button and our Ajax LiveButton).
Something else?

Thanks,
-ken


protected void Page_Init()
{
    Zoom1.ToolTip = "Test Caption...";
    Zoom1.WaitMessage = "Please wait";
    Zoom1.CaptionPosition = Dart.PowerWEB.Zoom.DockPosition.Middle;
    Zoom1.EnableMagnifier = false;
    Zoom1.BackColor = System.Drawing.Color.White;
}

protected void Button1_Click(object sender, EventArgs e)
{
    //Switch between images
    string image = Zoom1.SourceImage;
    Zoom1.ClearTiles();
    Zoom1.Height = Unit.Pixel(400);
    Zoom1.Width = Unit.Pixel(400);
    Zoom1.SourceImage = (image == "Image1.jpg") ? "Image2.jpg" : "Image1.jpg";
}
earniep

From: Tualatin, OR USA
Posts: 14
Member Since: 07/02/08
posted July 14, 2008 12:39 PM

Ok,
I've narrowed at least the area of the issue.
When I tried what you suggested (new solution just with the control and I swap out two images), the issue was not recreatable (the 2nd image didn't cause the zoom control to grow in height.
However, when I added the AJAX ability, then it did.
Upon investigation, when I added "div { height: 0px; }" that seemed to resolve the issue (there wasn't much in the client source except for a couple <div> tags.
However, I obviuosly can't add that CSS to my product pages since it skews the layout of the other <div> tags that make up the page's layout.
So to restate, it works fine without AJAX, then with AJAX the zoom control grows about 10px in height upon subsequent image changes.
This is from within a new solution that uses no external CSS files (or any other files).
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 14, 2008 1:51 PM

Hi,
I still have not been able to see the problem.

I tried changing the images using a PowerWEB LiveButton control.
I also tried using standard Button and Zoom controls in an MS Ajax UpdatePanel.

Both techniques worked exactly the same as the standard button, except the changes occurred in a callback instead of a full postback.

It is possible other Ajax techniques may not produce as successful results, but unfortunately we cannot guarantee compatibility.

-ken
earniep

From: Tualatin, OR USA
Posts: 14
Member Since: 07/02/08
posted July 14, 2008 1:54 PM

Actually,
We are not using a "PowerWEB LiveButton control.", but a regular Web Control.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 14, 2008 5:23 PM

Hi,
To clarify my post, I tried a standard Button (in an UpdatePanel) as well, and it worked fine.
-ken
Reply | PowerWEB Zoom for ASP.NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX