473,395 Members | 1,488 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,395 software developers and data experts.

picture box doesn't keep its place after stretch

Hi ...

I have a form with a background and a picture box that displays another image , i set Backgroundimagelayout = stretch for them both, the problem that when running the application the image in the picture box doesn't keep its place , So any advice?

Nov 12 '08 #1
3 1552
tlhintoq
3,525 Expert 2GB
Would it be more accurate to say that the picturebox DOES keep its place, and that is the problem?

Correct me if I'm wrong but it looks like the form gets resized, but the picturebox on top of the form stays in its original location, so it looks out of place.

If you want it to stay in a certain location RELATIVE to the form it sits on you will have to relocate the picture box each time the form is resized. Try checking the Form.Bounds after each ResizeEnd event. You can then calculate the new position for the picturebox off of the Bounds.Right and Bounds.Bottom values.

Keep in mind, that if the images are set to stretch, then the images are resizing as well. That means the image in the picturebox will have to resize to match the form, and so the picturebox itself will have to resize to accommodate the resized picture it contains.
Nov 12 '08 #2
Thanx alot Mr.Tlhintoq

is it posible to solve this problem by using .Net function

this.ScaleControl(new SizeF(15, 30), BoundsSpecified.All);

If yes please explain how can I do that.
Nov 15 '08 #3
tlhintoq
3,525 Expert 2GB
Thanx alot Mr.Tlhintoq

is it posible to solve this problem by using .Net function

this.ScaleControl(new SizeF(15, 30), BoundsSpecified.All);

If yes please explain how can I do that.
I've never played with the scale function.
I usually just handle all the moving/sizing with the "resize end" or "size change" events.

It might require some experimentation on your part. Might have to do the placement based on percentages of window width & height. For example: Calculate the position 85% from the left and 75% from the top, then place your top box there.
Nov 16 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: jeff | last post by:
Hiya, Im currently in the process of developing a picture browser, I want it to run off a CD, basically I have 2 questions for the group. The first is how do I get the program to only view the...
10
by: Chris Coho, Jr. | last post by:
Ok, I'll explain the whole problem because there may be several ways to solve this and hopefully someone knows one. What I'm doing is creating a specialty template editor, similar to say a corel...
2
by: Sandra Setz | last post by:
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...
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...
6
by: Salad | last post by:
Hi: I have a Bill of Lading template from the printer that I saved as a BMP. I created a new report and in the report's picture property told it the BMP file name. It brought the image in just...
14
by: hamil | last post by:
I am trying to display an image in a picture box. The image is a group 4 fax black and white image of a piece of sheet music. The original resolution is 300 X 300 dpi. I want to have the picture...
1
by: dkalsow | last post by:
Good Afternoon, I want to write an application that functions somewhat like windows picture and fax viewer. I have it created and have put an image box on the form to handle the displaying of...
13
by: Jim Carlock | last post by:
I have over a hundred pictures I would like to present. Is it practical to create and parse an array of pictures, picture paths, et al using server-side scripting to accomplish this? I...
1
Ali Rizwan
by: Ali Rizwan | last post by:
Hi all, I want to stretch a picture set on form background. but not want to set the picture in an image box the picture must set on the form background and i don't wanrt to use image control. i...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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,...
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
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,...
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...
0
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...
0
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...

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.