От: | GlebZ | ||
Дата: | 04.04.07 11:47 | ||
Оценка: |
using System.Drawing;
namespace Scan
{
class Scanner
{
enum PixelColor {
| Black
| White
| EOFLine
| EOFFile
}
static GetNextPixel ( x:int, y:int, bmp:Bitmap) : int * int * Bitmap * PixelColor
{
when (x==bmp.Size.Width)
def _height=bmp.Height;
match (y){
|_height => (x, y, bmp, PixelColor.EOFFile)
| _ => (0, y+1, bmp, PixelColor.EOFLine)
}
when (bmp.GetPixel(x,y) == System.Drawing.Color.Black)
{(x+1, y, bmp, PixelColor.Black)}
(x+1, y, bmp, PixelColor.White)
}
static Parse(filePath:string):void
{
def bmp=Bitmap(filePath, false);
_=GetNextPixel(0, 0, bmp);
}
static Main() : void
{
_=Parse("barcode.bmp")
}
}
}
>C:\Program Files\Nemerle\ncc.exe -no-color -r System.Windows.Forms -r System.Data -t exe scan.n -o scan.exe
scan.n:19:1:19:6: warning: N10005: ignored computed value of type (int * int * System.Drawing.Bitmap * Scan.Scanner.PixelColor)
scan.n:19:1:19:6: hint: use `_ = ...'; or -nowarn:10005 to avoid the warning
scan.n:24:2:24:33: warning: N10005: ignored computed value of type (int * int * System.Drawing.Bitmap * Scan.Scanner.PixelColor)
scan.n:21:3:21:4: warning: this match clause is unused
>Exit code: 0