Re: Custom ImagePlaceholder...Want to maintain aspect ratio of image, and make image c
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > Re: Custom ImagePlaceholder...Want to maintain aspect ratio of image, and make image c




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-28-04 11: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...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
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> ");
>
> }
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:16 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register