473,654 Members | 3,062 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Elipse style fill gradient in a rectangle?

Hi does anyone know how to fill a rectangle with an ellipse style fill (ie so it gives a spotlight effect on a rectange?)

I know how to create rectangles, ellipses etc and I can fill the rect with an oversized ellipse, but given how far over the edge of the view it has to go, it loses the defining edges on the colours..... I need the fill to go out as far as the outer ellipse colour, and then the rest of the visible form take that colour.... I tried just setting the background colour on the form directly as an easy option, but that in turn discoloursmy flat buttons..... doh!

Please help.....

Cheers
Adam

Nov 21 '05 #1
2 2354
Hi,

Try drawing the forms background in the paint event instead of
setting the back color.

Ken
-----------------------
"Adam Maltby" <ad***@frfl.co. uk> wrote in message
news:ui******** *****@TK2MSFTNG P12.phx.gbl...
Hi does anyone know how to fill a rectangle with an ellipse style fill (ie
so it gives a spotlight effect on a rectange?)

I know how to create rectangles, ellipses etc and I can fill the rect with
an oversized ellipse, but given how far over the edge of the view it has to
go, it loses the defining edges on the colours..... I need the fill to go
out as far as the outer ellipse colour, and then the rest of the visible
form take that colour.... I tried just setting the background colour on the
form directly as an easy option, but that in turn discolours my flat
buttons..... doh!

Please help.....

Cheers
Adam
Nov 21 '05 #2
Ken,

Thanks matey! So obvious, right under my nose i never even considered it! Doh!

Thanks again!
Adam

Nov 21 '05 #3

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

Similar topics

1
4112
by: Robert W. | last post by:
In my Winforms app I'm trying to get an image's background to appear transparent on a form that has a gradient background. So I added a PictureBox and then attempted to add a custom paint command for the PictureBox. But it's not working. Here's the code I've written: public void InitializeLinearGradients() { this.Paint += new PaintEventHandler(PaintClient); this.SizeChanged += new EventHandler(SizeClient); pictureLogo.Paint += new...
5
2428
by: Woody Splawn | last post by:
I have a webform where I would like to have the background color for the webform be a gradient in blue. How do I do this? What is the easiest way? What is the way most used by other developers? Do you draw it with code or attach a .gif file as a background or what? Does one way or the other have an effect on speed? Thank You
0
951
by: Patrick Dugan | last post by:
I am using Visual Studio 2005 with Visual Basic. I am trying to create a vertical color-gradient rectangle. I want the rectangle to go from red on top to blue on the bottom. This is the routine I am using: ''''''''''''''''''''''''''''''''''' RectHeight = 50
3
6858
by: Robert W. | last post by:
In my WinForms app I'd long ago implemented a drag & drop mechanism just like is used in PowerPoint when one wants to rearrange the order of the slides. Specifically, a thin black line is shown between thumbnails to indicate where an item will be dropped. As the user moved away I'd erase it by simply drawing another line using the BackColor of the panel. This worked great! But I've recently switched to using a Gradient panel and so now...
0
3034
by: David Gouge | last post by:
Hi All, appreciate that this is more gdi+ than c# but always seem to get good answers here, so here goes... In a nutshell, all i want to do is add a gradient background to a ListView. I have gotten so far by: Adding the following to the constructor: this.SetStyle(ControlStyles.UserPaint, true);
4
5878
by: Jon Slaughter | last post by:
I'm drawing a linear gradient and its very "banded". The colors are far enough part that it should be plenty smooth enough but I always get the same number of bands regardless. I've tried to set g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.CompositingQuality = CompositingQuality.HighQuality;
0
3903
by: =?Utf-8?B?YWxleF9jYXJvMQ==?= | last post by:
Hi, I would like to use a multibinding to determine the fill value of my rectangle style. <Style x:Key="StyleRect" TargetType="{x:Type Rectangle}"> <Setter Property="Fill"> <Setter.Value> <MultiBinding Converter="{StaticResource MyMultiValueConverter}"> <Binding Path="PropertyX"/>
9
8137
by: Eric Lindsay | last post by:
How do you provide a consistent gradient fill as a background in a liquid layout? If I make a gradient fill image say 1000 pixels wide (and repeat it down the page) to suit a typical computer display, then only a small portion of the gradient will show if the viewpoint is a smaller PDA or phone display. On the other hand, if viewed full screen on a 1920 pixel wide display, I would run out of gradient on one or both sides of the page....
1
1860
by: Bryon | last post by:
My current code paints a rectangular area at the top (under the menu and tool strip) and bottom (top of the status strip) of the main form with a linear gradient. The problem is that when the form is resized or maximized for that matter, the form still displays the last areas that were painted with gradient. Basically the form does not erase the last graphics that were painted to the form and just paints over it with the new. My code is...
0
8375
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
8815
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
8707
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
8482
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
7306
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
6161
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
5622
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();...
1
2714
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.