Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
AnswerRe: error adding 2 Uint16s stored in a List structure Pin
Luc Pattyn25-May-12 2:21
sitebuilderLuc Pattyn25-May-12 2:21 
AnswerRe: error adding 2 Uint16s stored in a List structure Pin
BobJanova25-May-12 5:50
BobJanova25-May-12 5:50 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
harold aptroot25-May-12 6:01
harold aptroot25-May-12 6:01 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
RobCroll25-May-12 17:11
RobCroll25-May-12 17:11 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
harold aptroot25-May-12 23:05
harold aptroot25-May-12 23:05 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
Richard MacCutchan26-May-12 1:00
mveRichard MacCutchan26-May-12 1:00 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
harold aptroot26-May-12 1:04
harold aptroot26-May-12 1:04 
Questiongeometry combine Error Pin
mukesh methaniya25-May-12 0:41
mukesh methaniya25-May-12 0:41 
Here I am using follwing code for the Draw RoundRect.The Path geomatric use for the save RoundRect Points . there is only fault with round rect geometry when combine. single Roundrect geometry is appeared during drawing .but after combine its only Ellips geometry appeared and round rect not appeared.




// --------------------------------------------------------------- //
Below Function generate Round rect PathGeometry...........
// ---------------------------------------------------------------
public PathGeometry RoundRect() { Rect rect = new Rect(30, 30, 200, 200);
Pen pen = new Pen(null, 50); Brush brush = null;
CornerRadius cornerRadius = new CornerRadius(10, 10, 10,10);
var geometry = new StreamGeometry();
using (var context = geometry.Open()) { bool isStroked = pen != null;
const bool isSmoothJoin = true;
context.BeginFigure(rect.TopLeft + new Vector(0, cornerRadius.TopLeft), brush != null, true);
context.ArcTo(new Point(rect.TopLeft.X + cornerRadius.TopLeft, rect.TopLeft.Y), new Size(cornerRadius.TopLeft, cornerRadius.TopLeft), 90, false, SweepDirection.Clockwise, isStroked, isSmoothJoin);
context.LineTo(rect.TopRight - new Vector(cornerRadius.TopRight, 0), isStroked, isSmoothJoin);
context.ArcTo(new Point(rect.TopRight.X, rect.TopRight.Y + cornerRadius.TopRight), new Size(cornerRadius.TopRight, cornerRadius.TopRight), 90, false, SweepDirection.Clockwise, isStroked, isSmoothJoin);
context.LineTo(rect.BottomRight - new Vector(0, cornerRadius.BottomRight), isStroked, isSmoothJoin); context.ArcTo(new Point(rect.BottomRight.X - cornerRadius.BottomRight, rect.BottomRight.Y), new Size(cornerRadius.BottomRight, cornerRadius.BottomRight), 90, false, SweepDirection.Clockwise, isStroked, isSmoothJoin);
context.LineTo(rect.BottomLeft + new Vector(cornerRadius.BottomLeft, 0), isStroked, isSmoothJoin);
context.ArcTo(new Point(rect.BottomLeft.X, rect.BottomLeft.Y - cornerRadius.BottomLeft), new Size(cornerRadius.BottomLeft, cornerRadius.BottomLeft), 90, false, SweepDirection.Clockwise, isStroked, isSmoothJoin);
context.Close(); } PathGeometry pt = new PathGeometry();
pt = PathGeometry.CreateFromGeometry(geometry);
return pt;
}
//------------------------------------------------ Below Function generate Ellips PathGeometry...........
//----------------------------------------------- public PathGeometry ellips() { EllipseGeometry eGeo = new EllipseGeometry(new Rect(30, 30, 200, 200));
return eGeo.GetFlattenedPathGeometry();
} --------------------------------------------------------------- Below Function Combine both pathgeometry and make new pathgeometry --------------------------------------------------------------- PathGeometry pathGeometry = new PathGeometry();
PathGeometry pathGeometry1 = new PathGeometry();
PathGeometry pathGeometry2 = new PathGeometry(); protected override void OnRender(DrawingContext dc) { pathGeometry1 = this.RoundRect(); pathGeometry2 = ellips();
pathGeometry = PathGeometry.Combine(pathGeometry1, pathGeometry2, GeometryCombineMode.Union, null);
dc.DrawGeometry(null, new Pen(new SolidColorBrush(Colors.Red), 1), pathGeometry);
}


//---------------------------------------------------------------
// Output //
---------------------------------------------------------------
But here in outPut ,RoundRect Geometry is not appeared after combined , Only Ellips is appeared Please let me know the mistakee in My Code. Or suggest any other way to achive this functionality

modified 26-May-12 1:38am.

AnswerRe: geometry combine Error Pin
Richard MacCutchan25-May-12 1:07
mveRichard MacCutchan25-May-12 1:07 
QuestionResize Button according to windows form size Pin
sankar456724-May-12 21:51
sankar456724-May-12 21:51 
AnswerRe: Resize Button according to windows form size Pin
Cracked-Down24-May-12 22:07
Cracked-Down24-May-12 22:07 
Questiontake text data frome web Pin
sina rahimzadeh24-May-12 20:45
sina rahimzadeh24-May-12 20:45 
AnswerRe: take text data frome web Pin
Eddy Vluggen24-May-12 21:52
professionalEddy Vluggen24-May-12 21:52 
AnswerRe: take text data frome web Pin
AmitGajjar27-May-12 22:12
professionalAmitGajjar27-May-12 22:12 
QuestionComparing Times Pin
AmbiguousName24-May-12 19:57
AmbiguousName24-May-12 19:57 
AnswerRe: Comparing Times Pin
OriginalGriff24-May-12 20:33
mveOriginalGriff24-May-12 20:33 
GeneralRe: Comparing Times Pin
AmitGajjar27-May-12 22:18
professionalAmitGajjar27-May-12 22:18 
AnswerRe: Comparing Times Pin
Apocalypse Now24-May-12 20:53
Apocalypse Now24-May-12 20:53 
AnswerRe: Comparing Times Pin
AmitGajjar27-May-12 22:16
professionalAmitGajjar27-May-12 22:16 
QuestionCreating a table with the help Asp control at run time Pin
Naughty Ankur24-May-12 19:03
Naughty Ankur24-May-12 19:03 
AnswerRe: Creating a table with the help Asp control at run time Pin
Mycroft Holmes24-May-12 19:33
professionalMycroft Holmes24-May-12 19:33 
QuestionHow to convert document to flash (swf) Pin
quocviet_dhspkt24-May-12 15:32
quocviet_dhspkt24-May-12 15:32 
AnswerRe: How to convert document to flash (swf) Pin
sina rahimzadeh25-May-12 0:03
sina rahimzadeh25-May-12 0:03 
AnswerRe: How to convert document to flash (swf) Pin
wikizhao25-May-12 15:40
wikizhao25-May-12 15:40 
QuestionFalse positive executable ... Pin
amx_tiger24-May-12 10:14
amx_tiger24-May-12 10:14 

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.