473,802 Members | 1,978 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 5247
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
6929
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
2411
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
3270
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
9468
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
3584
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
9699
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
9562
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10305
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10285
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
10063
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
9115
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
7598
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
6838
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
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.