managed DX9 equivelent of DX8's D3DCOLORVALUE

smremde

Newcomer
Joined
Oct 10, 2003
Messages
6
does anyone know the managed DX9 equivelent of DX8's D3DCOLORVALUE - im trying to convert an vb app to vb.net. also the functions that go with colouts like D3DXColorLerp ...
 
Hmmm... I think you can just declare your own struct, as in:
C#:
	public struct ColorType
	{
		public byte b;
		public byte g;
		public byte r;
		public byte a;

		public ColorType(byte r, byte g, byte b)
		{ 
			this.r = r;
			this.g = g;
			this.b = b;
			this.a = 255;
		}
		public ColorType(Color c)
		{ 
			this.r = c.R;
			this.g = c.G;
			this.b = c.B;
			this.a = c.A;
		}
	}

At least, that's what I used for returns to the LockRectangle call.

The SDK might have a default color struct defined, I can't remember offhand.

-nerseus
 
the soluction i found was to use
Visual Basic:
System.Drawing.Color
and the
Visual Basic:
Microsoft.DirectX.Direct3D.ColorOperator
module to manipulate them

from the ms dx9 sdk documentation:
ColorOperator Class

--------------------------------------------------------------------------------

Contains methods for manipulating colors.

Definition

Visual Basic NotInheritable Public Class ColorOperator
Inherits Object
C# public sealed class ColorOperator : Object
Managed C++ public __gc __sealed class ColorOperator : public Object
JScript public class ColorOperator extends Object

Members Table

The following table lists the members exposed by the ColorOperator object.

Add - Adds two color values together to create a new color value.
AdjustContrast - Adjusts the contrast value of a color.
AdjustSaturation - Adjusts the saturation value of a color.
Lerp - Uses linear interpolation to create a color value.
Modulate - Blends two colors.
Negative - Creates the negative color value of a color value.
Scale - Scales a color value.
Subtract - Subtracts two color values to create a new color value.
 
Back
Top