How to make absolute perpendicular gradient painting possible


hi

i developing application in silveright 4. application has popup. i put popup window border , set cornerradius value appears rounded corners. wanted give custom gradientbrush border. created lineargradientbrush this. gave me lineargradient paint on border, not concept.

let me explain

silverlight default gradient brush behavior  silverlight default gradientbrush behavior. parallel filling

 

this happens this happens. gradientbrush not dependent shape

 

but want apply gradient window border. painting behavior must one...

the desired one here can see gradientbrush comes perpendicular shape. need perform kind of painting on border appears custom border graphics. there way create such gradientbrush or workaround can provide kind of brush resource?

 

i need stick requirement because window border.. , believe microsoft has done make real. can guys tell me how can achieved? appreciated. thank you

 

i created in expression design, think tweek need.

<canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:name="document" width="281" height="267" clip="f1 m 0,0l 281,0l 281,267l 0,267l 0,0">  	<canvas x:name="layer_1" width="800" height="600" canvas.left="0" canvas.top="0">  		<path x:name="path" width="281" height="267" canvas.left="0" canvas.top="-1.52588e-005" stretch="fill" fill="#ff002bff" data="f1 m 271,267l 10,267c 4.47716,267 0,262.523 0,257l 0,9.99998c 0,4.47713 4.47716,-1.52588e-005 10,-1.52588e-005l 271,-1.52588e-005c 276.523,-1.52588e-005 281,4.47713 281,9.99998l 281,257c 281,262.523 276.523,267 271,267 z "/>  		<viewbox x:name="group" width="279.591" height="265.864" canvas.left="0.772705" canvas.top="0.590836">  			<canvas width="279.591" height="265.864">  				<path x:name="path_0" width="279.591" height="265.864" canvas.left="0" canvas.top="6.10352e-005" stretch="fill" fill="#ff1727e8" data="f1 m 269.591,265.864l 10,265.864c 4.47716,265.864 0,261.386 0,255.864l 0,10.0001c 0,4.47714 4.47716,6.10352e-005 10,6.10352e-005l 269.591,6.10352e-005c 275.114,6.10352e-005 279.591,4.47714 279.591,10.0001l 279.591,255.864c 279.591,261.386 275.114,265.864 269.591,265.864 z "/>  				<path x:name="path_1" width="278.182" height="264.727" canvas.left="0.772781" canvas.top="0.590881" stretch="fill" fill="#ff2e23d1" data="f1 m 268.955,265.318l 10.7728,265.318c 5.24989,265.318 0.772781,260.841 0.772781,255.318l 0.772781,10.5909c 0.772781,5.06796 5.24989,0.590881 10.7728,0.590881l 268.955,0.590881c 274.477,0.590881 278.955,5.06796 278.955,10.5909l 278.955,255.318c 278.955,260.841 274.477,265.318 268.955,265.318 z "/>  				<path x:name="path_2" width="276.773" height="263.591" canvas.left="1.54549" canvas.top="1.18182" stretch="fill" fill="#ff451fba" data="f1 m 268.318,264.773l 11.5455,264.773c 6.02266,264.773 1.54549,260.296 1.54549,254.773l 1.54549,11.1818c 1.54549,5.65894 6.02266,1.18182 11.5455,1.18182l 268.318,1.18182c 273.841,1.18182 278.318,5.65894 278.318,11.1818l 278.318,254.773c 278.318,260.296 273.841,264.773 268.318,264.773 z "/>  				<path x:name="path_3" width="275.364" height="262.455" canvas.left="2.31822" canvas.top="1.77267" stretch="fill" fill="#ff5d1ba2" data="f1 m 267.682,264.227l 12.3182,264.227c 6.79536,264.227 2.31822,259.75 2.31822,254.227l 2.31822,11.7727c 2.31822,6.24982 6.79536,1.77267 12.3182,1.77267l 267.682,1.77267c 273.205,1.77267 277.682,6.24982 277.682,11.7727l 277.682,254.227c 277.682,259.75 273.205,264.227 267.682,264.227 z "/>  				<path x:name="path_4" width="273.955" height="261.318" canvas.left="3.09096" canvas.top="2.36359" stretch="fill" fill="#ff74178b" data="f1 m 267.045,263.682l 13.0909,263.682c 7.5681,263.682 3.09096,259.205 3.09096,253.682l 3.09096,12.3636c 3.09096,6.8407 7.5681,2.36359 13.0909,2.36359l 267.045,2.36359c 272.568,2.36359 277.045,6.8407 277.045,12.3636l 277.045,253.682c 277.045,259.205 272.568,263.682 267.045,263.682 z "/>  				<path x:name="path_5" width="272.545" height="260.182" canvas.left="3.86369" canvas.top="2.95444" stretch="fill" fill="#ff8b1474" data="f1 m 266.409,263.136l 13.8637,263.136c 8.34084,263.136 3.86369,258.659 3.86369,253.136l 3.86369,12.9544c 3.86369,7.43158 8.34084,2.95444 13.8637,2.95444l 266.409,2.95444c 271.932,2.95444 276.409,7.43158 276.409,12.9544l 276.409,253.136c 276.409,258.659 271.932,263.136 266.409,263.136 z "/>  				<path x:name="path_6" width="271.136" height="259.045" canvas.left="4.63646" canvas.top="3.54529" stretch="fill" fill="#ffa2105d" data="f1 m 265.773,262.591l 14.6365,262.591c 9.1136,262.591 4.63646,258.114 4.63646,252.591l 4.63646,13.5453c 4.63646,8.02243 9.1136,3.54529 14.6365,3.54529l 265.773,3.54529c 271.296,3.54529 275.773,8.02243 275.773,13.5453l 275.773,252.591c 275.773,258.114 271.296,262.591 265.773,262.591 z "/>  				<path x:name="path_7" width="269.727" height="257.909" canvas.left="5.40916" canvas.top="4.1362" stretch="fill" fill="#ffba0c45" data="f1 m 265.136,262.045l 15.4092,262.045c 9.88631,262.045 5.40916,257.568 5.40916,252.045l 5.40916,14.1362c 5.40916,8.61334 9.88631,4.1362 15.4092,4.1362l 265.136,4.1362c 270.659,4.1362 275.136,8.61334 275.136,14.1362l 275.136,252.045c 275.136,257.568 270.659,262.045 265.136,262.045 z "/>  				<path x:name="path_8" width="268.318" height="256.773" canvas.left="6.1819" canvas.top="4.72714" stretch="fill" fill="#ffd1082e" data="f1 m 264.5,261.5l 16.1819,261.5c 10.6591,261.5 6.1819,257.023 6.1819,251.5l 6.1819,14.7271c 6.1819,9.20428 10.6591,4.72714 16.1819,4.72714l 264.5,4.72714c 270.023,4.72714 274.5,9.20428 274.5,14.7271l 274.5,251.5c 274.5,257.023 270.023,261.5 264.5,261.5 z "/>  				<path x:name="path_9" width="266.909" height="255.636" canvas.left="6.95461" canvas.top="5.31793" stretch="fill" fill="#ffe80417" data="f1 m 263.864,260.954l 16.9546,260.954c 11.4318,260.954 6.95461,256.477 6.95461,250.954l 6.95461,15.3179c 6.95461,9.79504 11.4318,5.31793 16.9546,5.31793l 263.864,5.31793c 269.387,5.31793 273.864,9.79504 273.864,15.3179l 273.864,250.954c 273.864,256.477 269.387,260.954 263.864,260.954 z "/>  			</canvas>  		</viewbox>  		<path x:name="path_10" width="265.5" height="254.5" canvas.left="8.50008" canvas.top="6.49971" stretch="fill" fill="#ffff0000" data="f1 m 264,261l 18.5001,261c 12.9772,261 8.50008,256.523 8.50008,251l 8.50008,16.4997c 8.50008,10.9768 12.9772,6.49971 18.5001,6.49971l 264,6.49971c 269.523,6.49971 274,10.9768 274,16.4997l 274,251c 274,256.523 269.523,261 264,261 z "/>  		<viewbox x:name="group_11" width="264.227" height="253.088" canvas.left="9.1364" canvas.top="7.22701">  			<canvas width="264.227" height="253.088">  				<path x:name="path_12" width="264.227" height="253.088" canvas.left="0" canvas.top="0" stretch="fill" fill="#ffe80417" data="f1 m 254.227,253.088l 10,253.088c 4.47717,253.088 0,248.611 0,243.088l 0,10c 0,4.47711 4.47717,0 10,0l 254.227,0c 259.75,0 264.227,4.47711 264.227,10l 264.227,243.088c 264.227,248.611 259.75,253.088 254.227,253.088 z "/>  				<path x:name="path_13" width="262.955" height="251.676" canvas.left="0.636414" canvas.top="0.727295" stretch="fill" fill="#ffd1082e" data="f1 m 253.591,252.404l 10.6364,252.404c 5.11356,252.404 0.636414,247.926 0.636414,242.404l 0.636414,10.7272c 0.636414,5.20438 5.11356,0.727295 10.6364,0.727295l 253.591,0.727295c 259.114,0.727295 263.591,5.20438 263.591,10.7272l 263.591,242.404c 263.591,247.926 259.114,252.404 253.591,252.404 z "/>  				<path x:name="path_14" width="261.682" height="250.264" canvas.left="1.27277" canvas.top="1.45462" stretch="fill" fill="#ffba0c45" data="f1 m 252.955,251.719l 11.2727,251.719c 5.74994,251.719 1.27277,247.242 1.27277,241.719l 1.27277,11.4546c 1.27277,5.93176 5.74994,1.45462 11.2727,1.45462l 252.955,1.45462c 258.477,1.45462 262.955,5.93176 262.955,11.4546l 262.955,241.719c 262.955,247.242 258.477,251.719 252.955,251.719 z "/>  				<path x:name="path_15" width="260.409" height="248.853" canvas.left="1.90912" canvas.top="2.18195" stretch="fill" fill="#ffa2105d" data="f1 m 252.318,251.035l 11.9091,251.035c 6.38626,251.035 1.90912,246.557 1.90912,241.034l 1.90912,12.1819c 1.90912,6.65909 6.38626,2.18195 11.9091,2.18195l 252.318,2.18195c 257.841,2.18195 262.318,6.65909 262.318,12.1819l 262.318,241.034c 262.318,246.557 257.841,251.035 252.318,251.035 z "/>  				<path x:name="path_16" width="259.136" height="247.441" canvas.left="2.54547" canvas.top="2.90918" stretch="fill" fill="#ff8b1474" data="f1 m 251.682,250.35l 12.5455,250.35c 7.02261,250.35 2.54547,245.873 2.54547,240.35l 2.54547,12.9091c 2.54547,7.38629 7.02261,2.90918 12.5455,2.90918l 251.682,2.90918c 257.205,2.90918 261.682,7.38629 261.682,12.9091l 261.682,240.35c 261.682,245.873 257.205,250.35 251.682,250.35 z "/>  				<path x:name="path_17" width="257.864" height="246.029" canvas.left="3.18185" canvas.top="3.63651" stretch="fill" fill="#ff74178b" data="f1 m 251.045,249.665l 13.1818,249.665c 7.659,249.665 3.18185,245.188 3.18185,239.665l 3.18185,13.6365c 3.18185,8.11365 7.659,3.63651 13.1818,3.63651l 251.045,3.63651c 256.568,3.63651 261.045,8.11365 261.045,13.6365l 261.045,239.665c 261.045,245.188 256.568,249.665 251.045,249.665 z "/>  				<path x:name="path_18" width="256.591" height="244.617" canvas.left="3.81821" canvas.top="4.3638" stretch="fill" fill="#ff5d1ba2" data="f1 m 250.409,248.981l 13.8182,248.981c 8.29538,248.981 3.81821,244.504 3.81821,238.981l 3.81821,14.3638c 3.81821,8.84094 8.29538,4.3638 13.8182,4.3638l 250.409,4.3638c 255.932,4.3638 260.409,8.84094 260.409,14.3638l 260.409,238.981c 260.409,244.504 255.932,248.981 250.409,248.981 z "/>  				<path x:name="path_19" width="255.318" height="243.205" canvas.left="4.45459" canvas.top="5.09106" stretch="fill" fill="#ff451fba" data="f1 m 249.773,248.296l 14.4546,248.296c 8.93173,248.296 4.45459,243.819 4.45459,238.296l 4.45459,15.0911c 4.45459,9.56824 8.93173,5.09106 14.4546,5.09106l 249.773,5.09106c 255.296,5.09106 259.773,9.56824 259.773,15.0911l 259.773,238.296c 259.773,243.819 255.296,248.296 249.773,248.296 z "/>  				<path x:name="path_20" width="254.045" height="241.793" canvas.left="5.09094" canvas.top="5.81842" stretch="fill" fill="#ff2e23d1" data="f1 m 249.136,247.612l 15.0909,247.612c 9.56812,247.612 5.09094,243.135 5.09094,237.612l 5.09094,15.8184c 5.09094,10.2955 9.56812,5.81842 15.0909,5.81842l 249.136,5.81842c 254.659,5.81842 259.136,10.2955 259.136,15.8184l 259.136,237.612c 259.136,243.135 254.659,247.612 249.136,247.612 z "/>  				<path x:name="path_21" width="252.773" height="240.381" canvas.left="5.72729" canvas.top="6.54572" stretch="fill" fill="#ff1727e8" data="f1 m 248.5,246.927l 15.7273,246.927c 10.2045,246.927 5.72729,242.45 5.72729,236.927l 5.72729,16.5457c 5.72729,11.0229 10.2045,6.54572 15.7273,6.54572l 248.5,6.54572c 254.023,6.54572 258.5,11.0229 258.5,16.5457l 258.5,236.927c 258.5,242.45 254.023,246.927 248.5,246.927 z "/>  			</canvas>  		</viewbox>  		<path x:name="path_22" width="251.5" height="238.97" canvas.left="15.5001" canvas.top="14.5" stretch="fill" fill="white" data="f1 m 257,253.47l 25.5,253.47c 19.9772,253.47 15.5001,248.992 15.5001,243.47l 15.5001,24.5c 15.5001,18.9771 19.9772,14.5 25.5,14.5l 257,14.5c 262.523,14.5 267,18.9771 267,24.5l 267,243.47c 267,248.992 262.523,253.47 257,253.47 z "/>  	</canvas>  </canvas>


 



Silverlight  >  Designing with Silverlight



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........