[Mono-bugs] [Bug 78185][Nor] Changed - [PATCH] Missing support for scalableAngle in LinearGradientBrush

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed May 3 00:29:27 EDT 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by billholmes54 at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=78185

--- shadow/78185	2006-05-03 00:28:11.000000000 -0400
+++ shadow/78185.tmp.29230	2006-05-03 00:29:27.000000000 -0400
@@ -10,13 +10,13 @@
 Component: libgdiplus
 AssignedTo: billholmes54 at gmail.com                            
 ReportedBy: sebastien at ximian.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
 URL: 
-Summary: Missing support for scalableAngle in LinearGradientBrush
+Summary: [PATCH] Missing support for scalableAngle in LinearGradientBrush
 
 Description of Problem:
 
 LinearGradientBrush doesn't propertly supports the following features:
 * FlipX, FlipY and FlipXY modes
 * Scalable angles
@@ -81,6 +81,33 @@
 
 
 ------- Additional Comments From billholmes54 at gmail.com  2006-05-03 00:28 -------
 Created an attachment (id=16909)
 Sample to show scale diff
 
+
+------- Additional Comments From billholmes54 at gmail.com  2006-05-03 00:29 -------
+That was awful!  After many days I have come up with a patch that is
+close to the real thing.  It is not an implementation that I am proud
+of but it works.
+
+I was able to find slightly better documentation for the
+isAngleScaleable argument.
+
+http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/GDIPlusreference/classes/lineargradientbrushclass/lineargradientbrushconstructors/lineargradientbrush_3rectamprect_colorampcolor1_colorampcolo.asp
+
+The important thing being …
+theta’ = arctan( (width / height) tan(theta) )
+
+The same brush look can be achieved by simply applying this formula to
+the previous logic for when this flag is false.  However the matrix
+was not correct.  There is a shear factor that I can not get an
+equation for.  That or a scale factor before the rotate operation.  
+
+What the equation above does provide is a way to determine the slope
+of the starting and ending boundaries.  Also I found that if the
+rectangle corners were transformed using the non scaled angle matrix
+that they had the right X or Y value.  I use the slope and the corners
+of the original rectangle to fill in the missing value.  
+
+With the three constructed point I then created a matrix from the
+original rectangle to the new points.


More information about the mono-bugs mailing list