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

how can i a image

hi
i'm a newer to c#,
how can i stretch a image when i resize the form

Image image=Image.FromFile("c:\1.jpg");

public override OnPoint(PaintEventArgs e)
{
e.Graphics.DrawImage(image,new
Rectangle(0,0,this.Size.Width,this.Size.Height),
new
Rectangle(0,0,image.Width,image.Height),GraphicsUn it.Pixel);
}
thank lots
Nov 16 '05 #1
1 1195
Hi,

Why don't you use PictureBox, set the dock property to fill and SizeMode to
StrechImage.

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"ÐìÇä" <pi**********@163.com> je napisal v sporoèilo
news:%2****************@tk2msftngp13.phx.gbl ...
hi
i'm a newer to c#,
how can i stretch a image when i resize the form

Image image=Image.FromFile("c:\1.jpg");

public override OnPoint(PaintEventArgs e)
{
e.Graphics.DrawImage(image,new
Rectangle(0,0,this.Size.Width,this.Size.Height),
new
Rectangle(0,0,image.Width,image.Height),GraphicsUn it.Pixel);
}
thank lots

Nov 16 '05 #2

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

Similar topics

15
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: marcellus7 | last post by:
Im looking for an image viewer that supports most types of image formats, including PDFs, and has the ability to rotate/zoom, and draw on an image. I've been looking but to no avail. Does anyone have...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.