Click here to Skip to main content
15,902,635 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow Can be redistributed with my setup the .net framework (Dotnetfx.exe). Pin
jlizardo30-Dec-03 3:34
jlizardo30-Dec-03 3:34 
AnswerRe: How Can be redistributed with my setup the .net framework (Dotnetfx.exe). Pin
Juergen Posny30-Dec-03 3:39
Juergen Posny30-Dec-03 3:39 
GeneralRe: How Can be redistributed with my setup the .net framework (Dotnetfx.exe). Pin
jlizardo30-Dec-03 4:36
jlizardo30-Dec-03 4:36 
GeneralDrawing regression line graph from points Pin
sunny027930-Dec-03 1:08
sunny027930-Dec-03 1:08 
GeneralCircle geometry Pin
cnurse30-Dec-03 0:47
cnurse30-Dec-03 0:47 
GeneralSolved it Pin
cnurse30-Dec-03 2:58
cnurse30-Dec-03 2:58 
GeneralHelp me How Exacrly i can use the pathGradiant brush Pin
EmanAli29-Dec-03 19:14
EmanAli29-Dec-03 19:14 
GeneralRe: Help me How Exacrly i can use the pathGradiant brush Pin
cnurse30-Dec-03 4:40
cnurse30-Dec-03 4:40 
Eman,

I just hacked this code out of my own C# project, hoping thatit will be of use to you. It may help clarify a few quirky things about PathGradientBrush. I think, by altering the focus parameter of SetTriangle... or SetSigma... in the code below, that you may be able to present a highlite at a position in a circle which approximates the look of a sphere. I honestly dont think you will get anything high quality though without breaking the sphere into triangles and shading each one appropriately, and that's way beyond me.

Another kludge you might use is to take a bitmap of a sphere, drawn in a 3D package or using Photopaint etc., and scaling it.

Well, for what its worth, here is my code, you will have to hack out my variables and try follow what's going on quite closely.


This method returns a brush that you can use on Graphics.FillPath.

prPath is a GraphicsPath
prFlip just flips a start and end color around
prBrushType is my enumeration which controls whether blends or triangle or bell type fills

public PathGradientBrush CreatePathBrush(GraphicsPath prPath)
{
Color lStart, lEnd; // Start and end color

PathGradientBrush lBrush; // Brush to assign to

lStart = Your Start Color;
lEnd = Your End Color;

// Create the linear brush
lBrush = new PathGradientBrush(prPath);
lBrush.CenterColor = lEnd;

// Create an array of colors which are the end color at each point
Color []lColors = new Color[prPath.PointCount];

for(int lCount = 0 ; lCount < prPath.PointCount ; lCount ++)
{
lColors[lCount] = lStart;
}

lBrush.SurroundColors = lColors;

// Experiment with the 0.5F figure, it should change the highlight on the shape you fill
// Of course you will want to fill a circle or ellipse would be better still.
lBrush.SetSigmaBellShape(0.5F);

return lBrush;

}


---------------

Hope this makes some kind of sense to you.



Nursey
GeneralRe: Thanks for the help Pin
Anonymous30-Dec-03 17:33
Anonymous30-Dec-03 17:33 
GeneralRe: Thanks for the help Pin
cnurse31-Dec-03 19:23
cnurse31-Dec-03 19:23 
GeneralOptionButton and recordset Pin
javad_p29-Dec-03 19:06
javad_p29-Dec-03 19:06 
GeneralRe: OptionButton and recordset Pin
Niels Penneman9-Jan-04 7:11
Niels Penneman9-Jan-04 7:11 
QuestionHow can I add different application in to a single deployment package? Pin
Member 76608429-Dec-03 18:49
Member 76608429-Dec-03 18:49 
GeneralOppinions of serialization Pin
cnurse29-Dec-03 13:51
cnurse29-Dec-03 13:51 
GeneralAPI Calls or VB.NET Code Pin
Don Hamilton29-Dec-03 11:50
Don Hamilton29-Dec-03 11:50 
GeneralRe: API Calls or VB.NET Code Pin
Niels Penneman9-Jan-04 7:14
Niels Penneman9-Jan-04 7:14 
GeneralRe: API Calls or VB.NET Code Pin
Niels Penneman9-Jan-04 7:15
Niels Penneman9-Jan-04 7:15 
GeneralDataGrid Text Wrap Pin
betterc29-Dec-03 5:57
betterc29-Dec-03 5:57 
GeneralRe: DataGrid Text Wrap Pin
Bernhard Hofmann13-Feb-04 1:01
Bernhard Hofmann13-Feb-04 1:01 
GeneralRe: DataGrid Text Wrap Pin
Bernhard Hofmann13-Feb-04 1:24
Bernhard Hofmann13-Feb-04 1:24 
GeneralRe: DataGrid Text Wrap Pin
Bernhard Hofmann25-Feb-04 0:46
Bernhard Hofmann25-Feb-04 0:46 
Generalerror of define a instance Pin
Frank Fan28-Dec-03 21:54
Frank Fan28-Dec-03 21:54 
QuestionHow to use array update the xml file?&amp;#9608;&amp;#9608;&amp;#9608; Pin
nichen100128-Dec-03 13:43
nichen100128-Dec-03 13:43 
GeneralHelp w/ loop &amp; directing data to field Pin
tiffanydw28-Dec-03 10:29
tiffanydw28-Dec-03 10:29 
GeneralRe: Help w/ loop &amp; directing data to field Pin
elRaptor29-Dec-03 8:12
elRaptor29-Dec-03 8:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.