How to change Image width dynamically when page is rendering?

Posted by Ksuresh under CSS 3 on 5/17/2012 | Points: 10 | Views : 1611 | Status : [Member] | Replies : 4
Hi All,

Is it possible to change image width dynamically when page is being render So how to do this, any one can help in this..

Thanks
Suresh




Responses

Posted by: Ajay.Kalol on: 6/6/2012 [Member] Starter | Points: 25

Up
0
Down
Why not ??
everything is Possible

try this

protected void Page_Load(object sender, EventArgs e)

{
ImageID.Width = 100;
ImageID.Height = 200;
}


enjoy..


Ajay
ajaypatelfromsanthal.blogspot.in

Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Manikattamuri on: 6/6/2012 [Member] Starter | Points: 25

Up
0
Down
Thank you, Ajay.Kalol ....

But in my situation there is no particular image Id , if there is lot of content with images and description in this situation i want to change images width when page is rendering.
Hope you understood my problem

Regards,
Suresh

Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ajay.Kalol on: 6/7/2012 [Member] Starter | Points: 25

Up
0
Down
Are you declaring your image in any Databind control ??
if So then Use Databind Control's Databound event to do this.
if you are Dynamically generate Image and assign size at that time(at declaration Time)
if you creating Image from .aspx Page then use ID property of control to access it code behind.

if not,
then what is your flow ?

Ajay
ajaypatelfromsanthal.blogspot.in

Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jobin on: 6/7/2012 [Member] Starter | Points: 25

Up
0
Down
Dim myBitmap As New Bitmap(Convert.ToInt32(width), Convert.ToInt32(height))
Dim myGraphics As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(myBitmap)
myGraphics .DrawImage(image, rectDestination, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel)

Ksuresh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response