Microsoft Content Management Server - Re: Custom ImagePlaceholder...Want to maintain aspect ratio of image, and make image c

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > July 2004 > Re: Custom ImagePlaceholder...Want to maintain aspect ratio of image, and make image c





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Custom ImagePlaceholder...Want to maintain aspect ratio of image, and make image c
Stefan [MSFT]

2004-07-28, 6:10 pm

Hi Alan,

you mean the image that is in your CMS repository has a wrong aspect ratio?
The code you listed just shows the image as it is in the repository.

If you only set width or height and not both at the img tag than IE will
preserve the aspect ratio.
Only if you set both the aspect ratio will be affected.
This seems to be more an html or IE related issue than a MCMS related issue
or did I miss the point?

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver

MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------


"Alan Taylor" <alan_taylor@nospam.uk.ibm.com> wrote in message
news:8safg09g3pk50fevi4s3ltfndjno1462mu@
4ax.com...
> Hi,
>
> I've written a custom image placeholder. I've overridden the Render
> method, and have so far I've managed to write code to make the image
> clickable, so that it the full image is shown in a new window, see
> code below.
>
> The problem is that the image shown on the posting isn't shown with
> the correct aspect ratio. How might I do this? The ImagePlaceholder
> doesn't have Height or Width properties?
>
>
> protected override void Render(HtmlTextWriter writer)
> {
> ImagePlaceholder pImage = this.BoundPlaceholder as ImagePlaceholder;
>
> writer.Write("<a href='" + pImage.Src + "' target='_blank'><img
> src='" + pImage.Src + "' alt='" + pImage.Alt + "'</a> ");
>
> }
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com