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

Resize an background image ???

Hi all
i need to resize a background image in a mdi parent form ? how can i do this
i have tryed to do in the resize event, and, in the overload background
paint, bla, bla .. and it didnīt show nothing..
can someone help me ????

thks
JSB
Jul 21 '05 #1
2 5211
Maybe this will help:

private void Page_Load(object sender, System.EventArgs e)
{

//create a new bitmap image
Bitmap InputBitmap = new Bitmap
(Server.MapPath("PictureName.gif"));

// create a new image from original
int newWidth = 100;
int newHeight = 100;
Bitmap OutputBitmap = new Bitmap
(InputBitmap, newWidth, newHeight);

// set the mime type
Response.Clear();
Response.ContentType="image/Gif";

// send the image to the viewer
OutputBitmap.Save(Response.OutputStream,
ImageFormat.Gif);

// clean up
OutputBitmap.Dispose();
InputBitmap.Dispose();
}

Dale Bonamie
-----Original Message-----
Hi all
i need to resize a background image in a mdi parent form ? how can i do thisi have tryed to do in the resize event, and, in the overload backgroundpaint, bla, bla .. and it didnīt show nothing..
can someone help me ????

thks
JSB
.

Jul 21 '05 #2
sorry, i need for winforms ..
i think that shouldnīt work in winforms ..

thks anyway
JSB

"Dale Bonamie" <Au*********@comcast.net> wrote in message
news:0a****************************@phx.gbl...
Maybe this will help:

private void Page_Load(object sender, System.EventArgs e)
{

//create a new bitmap image
Bitmap InputBitmap = new Bitmap
(Server.MapPath("PictureName.gif"));

// create a new image from original
int newWidth = 100;
int newHeight = 100;
Bitmap OutputBitmap = new Bitmap
(InputBitmap, newWidth, newHeight);

// set the mime type
Response.Clear();
Response.ContentType="image/Gif";

// send the image to the viewer
OutputBitmap.Save(Response.OutputStream,
ImageFormat.Gif);

// clean up
OutputBitmap.Dispose();
InputBitmap.Dispose();
}

Dale Bonamie
-----Original Message-----
Hi all
i need to resize a background image in a mdi parent form ? how can i do thisi have tryed to do in the resize event, and, in the overload backgroundpaint, bla, bla .. and it didnīt show nothing..
can someone help me ????

thks
JSB
.

Jul 21 '05 #3

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

Similar topics

2
by: Giovanni | last post by:
Hello, I need to insert a resized image in a html page. I know that using the html IMG tag it is possible to set the height and width attributes, with no need of php (or server-side...
2
by: tom | last post by:
Hello, does anyone know if and how it is possible that when you use an image as backgroundimage of a form, this image adjusts itself when the form resizes. Sth. like 'StretchImage' for a...
2
by: rams.kakara | last post by:
hi, My page have background image,on that image have more images and text. My problem is whenever resize browser that images are not resized and also not moved correct place .(i.e look not like...
8
by: Michael Satterwhite | last post by:
I'm opening a page that has a single image on it. I'd like to resize the window containing the image to the size of the image (slightly larger OK, not smaller). The width isn't a problem, but the...
3
by: Z D | last post by:
Hello, BACKGROUND: ============== I've created a Windows User Control that contains an Image Control (among other controls). The user control handles the picture resize event. Whenever the...
3
by: Mike | last post by:
I'm pulling an image from the db in binary format, i want to make the image the background of the web page - sort of. I want to display the image on the background of the page but centered on the...
2
by: Carl Gilbert | last post by:
Hi I am looking for either a component or technique to allow me to do the following: * Provide a panel with a background image * Resize the image to best fit the panel to maintain aspect...
2
by: Joao Santa Barbara | last post by:
Hi all i need to resize a background image in a mdi parent form ? how can i do this i have tryed to do in the resize event, and, in the overload background paint, bla, bla .. and it didnīt show...
3
by: =?Utf-8?B?UiBSZXllcw==?= | last post by:
Hi! This discussion may help other programmers get a better idea of how to save uploaded images through a website. Why? Well currently, I save 3 versions of every uploaded image on my own...
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: 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
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: 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
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
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...

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.