Good day to everyone.!

I just want to ask a help if is it possible to fit any size of image in just a 32 x 32 image placeholder.

i have already loaded the image from the database by just looking its path.but it it will display on the page more thatn the size of the image placeholder. How can i make the image fit on it. Is there a way.? please help

Thank & God bless on this mother earth.

Firstly, this should be in the HTML forum, secondly

<img height="32" width="32" src="blah.jpg />

... ...

Firstly, this should be in the HTML forum, secondly

<img height="32" width="32" src="blah.jpg />

... ...

Okey sir. Ive posts this in php forum because the back-end ive used is php & mysql.the moment ive trigger a query to load the image in the image placeholder by getting the image path. it will resize the placeholder and display the image larger thatn it.Ive already specified the height and width of the placeholder but the image does not follow it.

in vb6 ive just do sometihng like this.!

Picture1.PaintPicture Picture1.Picture, 0, 0, Picture1.Width, Picture1.Height

but i really dont know how to do this in php or javascript. Im eager to know about it.

God bless.!

The code posted by ShawnCplus would show the image and scale it down to 32x32.

Do you get the image path from the database? or are you storing the image itself in the database?

I am not sure exactly what you are asking, but I see no reason why the code from ShawnCplus won't work, post up your code onto the forum to see if anyone can spot the problem, and as said HTML issues can go to the HTML board (this will likely go there as it seems to be with displaying the image, not with retrieving the path)

The code posted by ShawnCplus would show the image and scale it down to 32x32.

Do you get the image path from the database? or are you storing the image itself in the database?

I am not sure exactly what you are asking, but I see no reason why the code from ShawnCplus won't work, post up your code onto the forum to see if anyone can spot the problem, and as said HTML issues can go to the HTML board (this will likely go there as it seems to be with displaying the image, not with retrieving the path)

Well for some reason, i preferred to post this issue on php forum for the reason that ive pull the nysql to dispay the image buy its path.I can see the image on the page but not with the type of width and height ive specified.here is my code: Assuming that ive already have a connection to mysql database.

<div align="center" width="32" height ="32"><img src="<?php echo $row_reclog['picture']; ?>" alt="" name="loginimg" border="0"></div>

I dont know whats wrong with this..

Thank you very much for giving me time.

God bless on this mother earth.

The problem is that you have specified the height and width for the div, not the image, the div will auto expand to allow its contents no need to assign height/width in this case. Move the height and width into the img tag.

<div style="text-align: center;"><img style="height:32px; width:32px;" src="<?php echo $row_reclog['picture']; ?>" alt="" name="loginimg" border="0"></div>

The problem is that you have specified the height and width for the div, not the image, the div will auto expand to allow its contents no need to assign height/width in this case. Move the height and width into the img tag.

<div style="text-align: center;"><img style="height:32px; width:32px;" src="<?php echo $row_reclog['picture']; ?>" alt="" name="loginimg" border="0"></div>

Thank you both very very very much. this problem was solved.

God bless on this mother earth.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.