473,789 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7241
> 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.P icture.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.P icture.Width, _
vbHimetric, vbTwips)
ScaleFactorY = Image1.Width / ScaleY(Image1.P icture.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.P icture.Width, _
vbHimetric, vbTwips)
ScaleFactorY = Image1.Width / ScaleY(Image1.P icture.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
7298
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 convert that? Thank you all
3
10468
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 show the picture in an imagecontrol, since the image is very large and I want to stretch it. But when I execute the following code:
2
3261
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 browser window border). How do I code this in HTML resp. CSS? If the user shrinks the browser window to a size which is smaller than the sum of the size of the two images image1.jpg + image2.jpg then all browser tend to position these pictures...
2
8974
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 = "C:\photo.bmp" Me!Photograph.Class = "Paint.Picture" Me!Photograph.OLETypeAllowed = acOLEEmbedded Me!Photograph.SourceDoc = strPathname Me!Photograph.Action = acOLECreateEmbed
4
2974
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 the user can move it around, so there could be a textbox, another picture, a button or nothing below the picture box. Setting the background color of the bitmap and of the picturebox to color.transparent does not seem to work. Another...
5
1890
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 learn how to do this or have any script examples? i would really appreciate it alot. thanks for you time jason
4
14153
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
1792
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: document.write('<div class="box" style="width:'+ w +'px">');
3
3821
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 reports the error in the console - "document.getElementById("image1") has no properties". Pls advice. thanks rupak <?xml version="1.0" encoding="UTF-8"?> <jsp:root version="1.2" ...> ...
0
9663
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9016
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.