473,395 Members | 2,010 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,395 software developers and data experts.

putting blue mask over image (GDI+)

I have an image but I want to put a transparent blue layer over it, how
would I do this? I want to make an effect similar to the one you get when
you select an icon and it turns blue. thanks!
Aug 2 '06 #1
2 2897
Smokey Grindle wrote:
I have an image but I want to put a transparent blue layer over it, how
would I do this? I want to make an effect similar to the one you get when
you select an icon and it turns blue. thanks!
How about this?

Image img = (Image)pictureBox1.Image.Clone();

using (Graphics g = Graphics.FromImage(img))
using (Brush brush = new SolidBrush(Color.FromArgb(70, Color.Blue))) {
g.FillRectangle(brush, 0, 0, img.Width, img.Height);
}

pictureBox1.Image = img;

hth,
Max
Aug 2 '06 #2
the problem with that is it even masks the transparent part of the image you
are blue masking... I want to preserve base image transparency

"Markus Stoeger" <sp******@gmx.atwrote in message
news:uW**************@TK2MSFTNGP06.phx.gbl...
Smokey Grindle wrote:
>I have an image but I want to put a transparent blue layer over it, how
would I do this? I want to make an effect similar to the one you get when
you select an icon and it turns blue. thanks!

How about this?

Image img = (Image)pictureBox1.Image.Clone();

using (Graphics g = Graphics.FromImage(img))
using (Brush brush = new SolidBrush(Color.FromArgb(70, Color.Blue))) {
g.FillRectangle(brush, 0, 0, img.Width, img.Height);
}

pictureBox1.Image = img;

hth,
Max

Aug 2 '06 #3

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

Similar topics

1
by: Prasad More | last post by:
Hello, I am trying to write a text on Multi-page TIFF image using C# and .NET GDI+. I have written following code to do this. When I execute this code I get "Invalid Parameter User. at...
2
by: Mark Roberts | last post by:
Greetings: Is it possible to put a small image into a ListView item when the target item is NOT the item 0 (ie: its not the item on the left-most column). What I am trying to accomplish is to...
1
by: Fahad Aijaz | last post by:
Hi, I am trying to display a Png image via ASP .NET. I get the image from the stream, creates the Bitmap, set the content type to Image/Png, but it give an error. If I set the content type to...
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...
6
by: JezB | last post by:
I have an Image object (i) which I want to write to a file. This does work but when I later try to do something with this file I get errors, because I think the file is still 'locked'. I have to...
2
by: Daniel Nogradi | last post by:
How does one do a histogram on only a part of an image? This is what I found in the PIL documentation about histogram( ): """ im.histogram(mask) =list Returns a histogram for those parts of...
2
by: user | last post by:
Hi all... i am trying to print an image using GDI - but the only thing i get is a black rectangle. Does anybody know what is wrong, or how else to get the bitmap on the printer (GDI+ is not...
14
by: Steve K. | last post by:
I have a method that I use to get a System.Drawing.Image from a file without keeping a handle on the file open (so I can delete the file). Here is the code: <code> public static Image...
5
by: Michael | last post by:
Hello all, how could I rotate a server side image in asp.net and show it in web page? Thanks.
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...
0
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...
0
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,...

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.