Imports Leadtools
Public Sub FromRgbExample()
Dim colors As RasterColor() = New RasterColor(RasterColor.MaximumComponent - RasterColor.MinimumComponent) {}
Dim i As Integer = RasterColor.MinimumComponent
Do While i < RasterColor.MaximumComponent
colors(i) = RasterColor.FromRgb(i)
i += 1
Loop
i = RasterColor.MinimumComponent
Do While i < RasterColor.MaximumComponent
Debug.Assert(colors(i).ToRgb() = i)
i += 1
Loop
End Sub
using Leadtools;
public void FromRgbExample()
{
RasterColor[] colors = new RasterColor[RasterColor.MaximumComponent - RasterColor.MinimumComponent + 1];
for(int i = RasterColor.MinimumComponent; i < RasterColor.MaximumComponent; i++)
{
colors[i] = RasterColor.FromRgb(i);
}
for(int i = RasterColor.MinimumComponent; i < RasterColor.MaximumComponent; i++)
{
Assert.IsTrue(colors[i].ToRgb() == i);
}
}
RasterColorExamples.prototype.FromRgbExample = function () {
with (Leadtools) {
var colors = new Array(RasterColorHelper.maximumComponent - RasterColorHelper.minimumComponent);
for (var i = RasterColorHelper.minimumComponent; i < RasterColorHelper.maximumComponent; i++) {
colors[i] = RasterColorHelper.fromRgb(i);
}
for (var i = RasterColorHelper.minimumComponent; i < RasterColorHelper.maximumComponent; i++) {
console.assert((RasterColorHelper.toRgb(colors[i]) === i), "Color not RGB");
}
}
}
using Leadtools;
public void FromRgbExample()
{
RasterColor[] colors = new RasterColor[RasterColorHelper.MaximumComponent - RasterColorHelper.MinimumComponent + 1];
for (int i = RasterColorHelper.MinimumComponent; i < RasterColorHelper.MaximumComponent; i++)
{
colors[i] = RasterColorHelper.FromRgb(i);
}
for (int i = RasterColorHelper.MinimumComponent; i < RasterColorHelper.MaximumComponent; i++)
{
Assert.IsTrue(RasterColorHelper.ToRgb(colors[i]) == i);
}
}
using Leadtools;
using Leadtools.Windows.Media;
public void FromRgbExample()
{
RasterColor[] colors = new RasterColor[RasterColor.MaximumComponent - RasterColor.MinimumComponent + 1];
for(int i = RasterColor.MinimumComponent; i < RasterColor.MaximumComponent; i++)
{
colors[i] = RasterColor.FromRgb(i);
}
for(int i = RasterColor.MinimumComponent; i < RasterColor.MaximumComponent; i++)
{
Debug.Assert(colors[i].ToRgb() == i);
}
}
Imports Leadtools
Imports Leadtools.Windows.Media
Public Sub FromRgbExample()
Dim colors As RasterColor() = New RasterColor(RasterColor.MaximumComponent - RasterColor.MinimumComponent){}
Dim i As Integer = RasterColor.MinimumComponent
Do While i < RasterColor.MaximumComponent
colors(i) = RasterColor.FromRgb(i)
i += 1
Loop
i = RasterColor.MinimumComponent
Do While i < RasterColor.MaximumComponent
Debug.Assert(colors(i).ToRgb() = i)
i += 1
Loop
End Sub