473,389 Members | 1,074 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,389 software developers and data experts.

Difference between Image1.Picture.Width and Image1.width

Hi,

I was wondering if someone could explain to me what the difference is
between the width propery of the picture property of an image and the width
property of the image itself.

I would have guessed that when the stretch property of an image was set to
false and an image was assigned to the picture property, that
Image1.Picture.Width and Image1.width would be the same. This is not the
case.

I need to know with what factor an image is stretched when stretched = true,
and I thought I could use these two different width properties, thinking
that Image1.width is the stretched width and Image1.Picture.width is the
actual width of the image.

Can someone help me figure this out?

Thanks in advance,
Sandra
Jul 17 '05 #1
2 7217
> I was wondering if someone could explain to me what the difference is
between the width propery of the picture property of an image and the width property of the image itself.

I would have guessed that when the stretch property of an image was set to false and an image was assigned to the picture property, that
Image1.Picture.Width and Image1.width would be the same. This is not the case.

I need to know with what factor an image is stretched when stretched = true, and I thought I could use these two different width properties, thinking that Image1.width is the stretched width and Image1.Picture.width is the actual width of the image.

Can someone help me figure this out?


The Width property of the Picture object contained within the ImageBox
is measured in something called HIMETRIC units. You can find out more
about this by looking up "HIMETRIC scale mode for value" (without the
quote marks) at the Index tab in VB's help files. To convert the
HIMETRIC units of the Picture to, say TWIPS (the assumed unit of measure
for your ImageBox), you would use the ScaleX and ScaleY methods (see the
help files for all of the conversion types possible).

ScaleX(Image1.Picture.Width, vbHimetric, vbTwips)

So, to find the scale factor by which your picture has been shrunk or
stretched, you could do this

ScaleFactorX = Image1.Width / ScaleX(Image1.Picture.Width, _
vbHimetric, vbTwips)
ScaleFactorY = Image1.Width / ScaleY(Image1.Picture.Width, _
vbHimetric, vbTwips)

Rick - MVP
Jul 17 '05 #2
"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote:
So, to find the scale factor by which your picture has been shrunk or
stretched, you could do this

ScaleFactorX = Image1.Width / ScaleX(Image1.Picture.Width, _
vbHimetric, vbTwips)
ScaleFactorY = Image1.Width / ScaleY(Image1.Picture.Width, _
vbHimetric, vbTwips)

Yes, this is what I was looking for. Thank you.

Sandra
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Yang Li Ke | last post by:
Anyone can tell me how to make sure that the width of a picture box would become 100 pixels width if i do use the autosize true because the width is like 2055 for a 100 pixel width how to...
3
by: Sandra Setz | last post by:
Hi, Is it possible to assign the Picture property of a picturebox to the Picture property of an image control? I use an invisble picturebox to make some changes to a picture, but I want to...
2
by: Jason Stacy | last post by:
On a webpage I would like to move image1.jpg as left as possible (directly to the browser window left border) and - simultaneously - the picture image2.jpg to the rightmost (directly to the right...
2
by: Lyn | last post by:
I am trying to embed a picture into a Bound Object Frame (Me!Photograph) with the following code which is based on MS article http://support.microsoft.com/?id=158941: strPathname =...
4
by: Andre Nogueira | last post by:
Hi there. I have one question... How can I create a bitmap (programmatically), paint it to a picture box and have a transparent background? I don't know what will be below the picturebox because...
5
by: jason.tadeo | last post by:
I was wondering if anyone does any uploading picture scripts or how to do it where i could upload a picture and use php to change the picture size to what i want it to be. Anyone know where i could...
4
by: SandyIsCool | last post by:
Hi, Can any one let me know what is difference between Server.mappath and Page.resolveURL and what are the situations we use them. Thanks, Sandy
3
by: find clausen | last post by:
Is it possible to get the width of a picture: <img src="../graphics/press/bw21.jpg" width=400 height=555 alt="" border="0"> the make a box be exactly the width of the picture: ...
3
by: rkhurana | last post by:
Hi I am writing a JSF application that uses some third party charts. While I can see the chart but the javascript that is supposed to calla function to update chart periodically has a problem. It...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.