473,830 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5248
Maybe this will help:

private void Page_Load(objec t sender, System.EventArg s e)
{

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

// 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.Conten tType="image/Gif";

// send the image to the viewer
OutputBitmap.Sa ve(Response.Out putStream,
ImageFormat.Gif );

// clean up
OutputBitmap.Di spose();
InputBitmap.Dis pose();
}

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*********@co mcast.net> wrote in message
news:0a******** *************** *****@phx.gbl.. .
Maybe this will help:

private void Page_Load(objec t sender, System.EventArg s e)
{

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

// 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.Conten tType="image/Gif";

// send the image to the viewer
OutputBitmap.Sa ve(Response.Out putStream,
ImageFormat.Gif );

// clean up
OutputBitmap.Di spose();
InputBitmap.Dis pose();
}

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
6931
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 processing). But my problem is the following: I need to use the resized image as a table background - and unfortunately html doesn't support the resize function for image used
2
1761
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 picturebox. thanx, t
2
1980
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 before alignment).I want to do everything in dyanamic. please help me. urs.. Rams
8
2414
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 height is. The window, of course has things like menu bars, toolbar, navigation, etc. I need to account for these when I resize the image, but I'm not seeing how to do that. I'm sure this must be done frequently, but I'm not seeing the solution. ...
3
3271
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 parent that holds my user control is resized, I resize my image so that it uses the maximum available space. Note: It takes about 2 seconds to regenerate the
3
1706
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 page and not be the entire background. I want to keep the bgcolor but have the image centered and only show it once on the page and not multiple times. is this possible or no?
2
9474
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 ratio * Provide white (or other color) borders at the sides or the top/bottom The last point would be used to allow users to resize the panel to any ratio
2
346
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 nothing.. can someone help me ???? thks JSB
3
3585
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 little website: 1. Small: DOWNsize of original image to be used as a thumbnail. 2. Medium: DOWNsize of original image to be used as user avatars/icons in forums or profiles.
0
9781
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
10769
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...
0
10197
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
9310
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...
1
7740
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5615
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...
2
3956
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3072
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.