🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.csharpbuilder.aspdotnet.general
3 messages
3 total messages Started by Daniel Becroft Mon, 13 Sep 2004 07:49
Image Centering Problem
#14
Author: Daniel Becroft
Date: Mon, 13 Sep 2004 07:49
19 lines
1810 bytes
Hi all,

I am currently using the server-side Image control to display images, with the image paths being
stored in an SQL database. Everything is working fine, but I have run into a small problem with the
image sizes. Currently, some images are smaller than others, and when they are displayed in the
control, they are stretched, and hence distorted.

Is there any way I can automatically centre the image without changing the size of the control? The
only other options I would have then, would be either modifying the size of the control for each
image, or resizing all the images.

-- 
Daniel Becroft
; =================================
"Real computer scientists don't comment their code. The identifiers are so long they can't afford
the disk space."

"Blue sparks and white smoke, the two most expensive components of any electrical system, and once
used up will cost a fortune to replace."
Re: Image Centering Problem
#15
Author: Joe Mayo
Date: Thu, 16 Sep 2004 13:38
42 lines
2237 bytes
Hi Daniel,

You shouldn't specify a Height or Width for your image control.  Then put it
inside of a table and center the image control in the cell.

Joe
-- 
Joe Mayo, Author/Instructor
Need C#/.NET training?
visit www.mayosoftware.com
C# Tutorial - www.csharp-station.com



"Daniel Becroft" <djcbecroft@hotmail.com> wrote in message
news:xn0dn83k1m3azp002@newsgroups.borland.com...
> Hi all,
>
> I am currently using the server-side Image control to display images, with
the image paths being
> stored in an SQL database. Everything is working fine, but I have run into
a small problem with the
> image sizes. Currently, some images are smaller than others, and when they
are displayed in the
> control, they are stretched, and hence distorted.
>
> Is there any way I can automatically centre the image without changing the
size of the control? The
> only other options I would have then, would be either modifying the size
of the control for each
> image, or resizing all the images.
>
> -- 
> Daniel Becroft
> ; =================================
> "Real computer scientists don't comment their code. The identifiers are so
long they can't afford
> the disk space."
>
> "Blue sparks and white smoke, the two most expensive components of any
electrical system, and once
> used up will cost a fortune to replace."
Re: Image Centering Problem
#16
Author: Daniel Becroft
Date: Thu, 16 Sep 2004 21:25
18 lines
1553 bytes
Joe Mayo wrote:

> Hi Daniel,
> 
> You shouldn't specify a Height or Width for your image control.  Then put it
> inside of a table and center the image control in the cell.

Thanks, Joe. I ended up doing that thanks to the very same suggestion from someone in the 
microsoft.public.dotnet.framework.aspnet.controls group.

-- 
Daniel Becroft
; =================================
"Real computer scientists don't comment their code. The identifiers are so long they can't afford
the disk space."

"Blue sparks and white smoke, the two most expensive components of any electrical system, and once
used up will cost a fortune to replace."
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads