473,378 Members | 1,142 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,378 software developers and data experts.

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 2339
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*************@TK2MSFTNGP12.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
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...
5
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? ...
0
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...
3
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...
0
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...
4
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...
0
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>...
9
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.