如何:旋转颜色

来源:学生作业帮助网 编辑:作业帮 时间:2024/06/09 01:16:12
如何:旋转颜色
x}ToPWN惭a|X|.[AC$ȱ4酴e!3]4CyynLbHN*Dh`l5PV_ ")5k ѹotf+GLЇQN޾ 棕Tp!Cd6AlpN8ZT<~Ot]~DA{vmʻQבϦ'vvA_V<~~H觟)5F5N&sK뱔&n[*M\TMgb[뼄zM(1|oMw,9$BpYt'DE4غM1GQ=,`-wFcQȓÂk@hQ=64֠+(,s7xRIGkg=QD^!=PkU 0 2, mxZ2qUg4 . <גJŹՅ,BJӳqm37֙/d҇2jC5"EzW"/P{

如何:旋转颜色
如何:旋转颜色

如何:旋转颜色
下面的示例将一个使用一种颜色 (1, 0, 0.6) 的图像围绕蓝色轴旋转 60 度.
旋转角度在与红色-绿色平面平行的平面上扫出.
下面的插图在左侧显示原来的图像,在右侧显示颜色旋转后的图像.
下面的插图形象地显示利用下面的代码进行的颜色旋转.C#VBPrivateSubRotateColors(ByValeAsPaintEventArgs)DimimageAsBitmap =NewBitmap("RotationInput.bmp")DimimageAttributesAsNewImageAttributes()DimwidthAsInteger= image.WidthDimheightAsInteger= image.HeightDimdegreesAsSingle= 60.0FDimrAsDouble= degrees * System.Math.PI / 180
' degrees to radiansDimcolorMatrixElementsAsSingle()() = { _NewSingle() {CSng(System.Math.Cos(r)), _CSng(System.Math.Sin(r)), 0, 0, 0}, _NewSingle() {CSng(-System.Math.Sin(r)), _CSng(-System.Math.Cos(r)), 0, 0, 0}, _NewSingle() {0, 0, 2, 0, 0}, _NewSingle() {0, 0, 0, 1, 0}, _NewSingle() {0, 0, 0, 0, 1}}DimcolorMatrixAsNewColorMatrix(colorMatrixElements)
imageAttributes.SetColorMatrix( _
colorMatrix, _
ColorMatrixFlag.
Default