473,657 Members | 2,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Fade Image Region with GDI+ ?

I want to read an image from disk, get the total width,
and then find the bottom region (say an area of 120 high
x the total width) and fade-away each pixel by a
percentage to white, and then output that memory-modified
image to the HTTP stream.

Where should I look for info or samples on doing that?

Thanks.
Nov 18 '05 #1
2 1789
I doubt you're going to find a sample. However, I think I can give you a
basic idea of what you need to do, and let you run with it from there.
Baiscally, it sounds like what you want to do is to draw a gradient
rectangle over a portion of your image. The gradient rectangle would be
fully-transparent at one end, and fully-white on the other. This would give
you the effect you described. For detailed information about how to use the
System.Drawing Namespace to do this, check out the System.Drawing Namespace
in the .Net SDK.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"localhost" <pr*******@coho rt.ces> wrote in message
news:00******** *************** *****@phx.gbl.. .
I want to read an image from disk, get the total width,
and then find the bottom region (say an area of 120 high
x the total width) and fade-away each pixel by a
percentage to white, and then output that memory-modified
image to the HTTP stream.

Where should I look for info or samples on doing that?

Thanks.

Nov 18 '05 #2
Hi localhost,

Thank you for using Microsoft Newsgroup Service. Based on your description,
you want some instructions or samples on how to operate on a Image grapchic
object in .NET and also you want to output the graphic as a stream to the
http web response.

I think the GDI+ APIS in dotnet provides plentiful functions on Graphic
operations, such as read/write image. And all images can be dealt with as a
Graphic object, you can edit the graphic object's attirbutes in may ways
such as by pixel or by a region area ...
For the detailed instruction and sample, you may visit the tutorial on
DOTNET QuickStart -> Graphic topic, here is the weblink to it:
http://samples.gotdotnet.com/quickst...DIPlus.aspx#Al
pha Blending

As for output a graphic to the http stream, it is as easy as to output a
graphic to a normal IOStream, an here is a good example shows "How to
Optimizing Color Quantization for ASP.NET Images", I believe it'll be
helpful.

http://msdn.microsoft.com/library/en....asp?frame=tru
e

Please have a look at the preceding web tutorials and let know if you need
any help.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3

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

Similar topics

12
8430
by: Acer | last post by:
Hi, Can somebody help me to create a php function which show an image, fade-out to another images ? thx
2
3991
by: Susanna | last post by:
Hi all, I'm using the following slideshow script that I found on the web to display changing images with a crossfade effect. Eventually I will be adding many more images to the slideshow. The thing is, I ALSO have to make it so the images will load randomly. I have looked at a number of scripts for random-loading slideshows, but I have to find a way to COMBINE this fading-image script (or, a different fading-image script, if...
1
7277
by: Robert Skidmore | last post by:
I am building an application that will fade one panel to another panel. Both panels will have picture boxes in them (thumbnails). This is what I have tried: private void fade(System.Windows.Forms.Panel fP){ for (int i = 255; i >= 0;i--){ System.Threading.Thread.Sleep(10); fP.BackColor = System.Drawing.Color.FromArgb(i, 255,255,255); System.Windows.Forms.Application.DoEvents();
4
4577
by: Brian Basquille | last post by:
Hello all, Quick question! How would i keep a point inside a region? For example, the mouse pointer. You should be able to move the mouse around in this region but not anywhere outside it. How would i go about doing this?
1
3591
by: BillZondlo | last post by:
Can someone look at this and tell me why, when I call this from my main app, it displays fine (fades form in and out) but then before my main app displays, I see other dialog boxes flash monentarily on the screen and this delays the main app display? Here is the fade which I compile to a dll and call from my main app: using System; using System.Threading; using System.Timers;
12
1345
by: clintonG | last post by:
VS2005 2.0 Beta 2 noting I've posted (to no avail so far) to the somewhat deadzone at news://microsoft.public.vsnet.ide and am getting ants in my pants for some discussion about this issue. Using regions to manage source code in the IDE is very useful however I prefer to align the region text on the left-most margin of the editor, i.e. margin-left 0; that is. The examples which follow show what I prefer and how VS2005 reformats the...
2
2693
by: Emil | last post by:
Hi, if you open the link below and click on "Show Me" and then "Toggle Transition" Button you will see a wonderfull fade in / fade out transition of 2 pictures. http://msdn.microsoft.com/library/default.asp?url=/workshop/author/filter/reference/filters/fade.asp I want to have the same effect in Visual C++, dosen't matter with / or without GDI+, but no .NET. I have a simple dialog with some controls and I
2
2511
by: Mark Denardo | last post by:
Hi, I need some expert GDI+ person to help me with my RoundOffImage Function: What I'm trying to do is take in an image, crop off the edges around an ellipse region I set up, and then return the cropped image from the function. I sort of have this working, but not thoroughly. If I take the output image of this function and draw it on my form it shows the clipped image as transparent as I am wanting it. But if I take that image and...
4
4955
by: pt36 | last post by:
Hi I have a small script function photo(a){ var photo = a ; document.getElementById(photoID).innerHTML = photo; } and on the body
0
8392
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
8305
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
8823
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...
1
8503
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
5632
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
4151
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...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1604
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.