Anda di halaman 1dari 1

01/02/2017 windowsHowtoRotateShapesinC#StackOverflow

signup login tour help

xDismiss

JointheStackOverflowCommunity

Stack Overflow is a community of 6.6 million


programmers, just like you, helping each other.
Join them it only takes a minute:

Signup

HowtoRotateShapesinC#

IhaveashapeinmyC#codelikeanellipse.NowIwanttoprogrammaticallyrotateit.Forexample,nowIhaveaverticalellipseandinthe
runningIwanttochangeittoahorizontalone.HowIsitpossible?

c# windows

editedJul3'14at21:57 askedJul3'14at20:42
michaelc35 AliNGame
307 2 11 160 9

3 WPF,Winforms?Whattechareyouusing?BradleyDotNETJul3'14at20:44

HowareyourepresentingthatEllipseinyourcode? BenjaminScheibe Jul3'14at20:45

1 Withoutsomeinformationabouthowyourellipseisrepresentedand/orhowyou'redrawingit,it'simpossible
tosay.Typicallyyouuseatransformationmatrixtotransformtheshapeoritsindividualpoints.Butagain,
theformthatmatrixtakesdependsonyourshape'srepresentation.Withoutmoreinformationfromyou,we
can'tansweryourquestion.JimMischelJul3'14at21:16

Thankguys.mycodeisC#forwindowsphone8.inwindowsphoneprogrammingIaddusing
Microsoft.Expression.ShapesthenIusethiscodetoadditinaGrid: AliNGame Jul4'14at4:29

Ellipsebtn=newEllipse()btn.width=100btn.height=100grid.children.add(btn) AliNGame Jul4'14


at4:30

1Answer

ProblemSolved:

CompositeTransformco=newCompositeTransform();
co.Rotation=90;
btn.RenderTransform=co;

answeredJul4'14at6:54
AliNGame
160 9

http://stackoverflow.com/questions/24562995/howtorotateshapesincsharp 1/1

Anda mungkin juga menyukai