public MyColor ReadTexture(double u, double v) { u = u * (TextureWidth - 1); v = v * (TextureHeight - 1); int x = (int)(u + 0.5); int y = (int)(v + 0.5); x = MyStaticMethod.CMID(x, 0, TextureWidth - 1); y = MyStaticMethod.CMID(y, 0, TextureHeight - 1); return(TextureImage[TextureHeight - 1 - y, x]); }
public Color ConvertToColor() { /* * int r = (int)(this.r * 255); * int g = (int)(this.g * 255); * int b = (int)(this.b * 255); */ int r = (int)(this.r); int g = (int)(this.g); int b = (int)(this.b); r = MyStaticMethod.CMID(r, 0, 255); g = MyStaticMethod.CMID(g, 0, 255); b = MyStaticMethod.CMID(b, 0, 255); return(Color.FromArgb(r, g, b)); }