X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=dev4%2Fpsychlops%2Fcore%2Fgraphic%2Fimage.cs;fp=dev4%2Fpsychlops%2Fcore%2Fgraphic%2Fimage.cs;h=64f3c1efe6cde1c59e6421322be7615f0ecf7d45;hb=7bd951bfbca3432f306f4f114cc0b06f47e13ed9;hp=c56ea61629c9ff20ca0029cd45be5fd909cb38e5;hpb=9f8568031d705f64bd1401dd20f24c282c48ea18;p=psychlops%2Fsilverlight.git diff --git a/dev4/psychlops/core/graphic/image.cs b/dev4/psychlops/core/graphic/image.cs index c56ea61..64f3c1e 100644 --- a/dev4/psychlops/core/graphic/image.cs +++ b/dev4/psychlops/core/graphic/image.cs @@ -38,6 +38,11 @@ namespace Psychlops{ self_rect = new Rectangle(wid, hei); initialize__(wid, hei); } + public Image(double wid, double hei) + { + self_rect = new Rectangle(Math.round(wid), Math.round(hei)); + initialize__((int)Math.round(wid), (int)Math.round(hei)); + } public Image set(int wid, int hei) { @@ -45,6 +50,12 @@ namespace Psychlops{ initialize__(wid, hei); return this; } + public Image set(double wid, double hei) + { + self_rect = new Rectangle(Math.round(wid), Math.round(hei)); + initialize__((int)Math.round(wid), (int)Math.round(hei)); + return this; + } public Figure shift(Point p) { @@ -66,6 +77,30 @@ namespace Psychlops{ buffer.SetPixel(x, y, col); } + public void release() + { + } + + public void cache(bool on_off = true) + { + } + + public void alpha(int x, int y, double a) + { + buffer.SetPixel(x, y, (byte)(a*255), buffer.GetPixel(x, y)); + } + + public void clear(Color col) + { + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + pix(x, y, col); + } + } + } + public void field(System.Func func) { @@ -104,6 +139,15 @@ namespace Psychlops{ public double getHcenter() { return width / 2.0; } public double getVcenter() { return height / 2.0; } + public double left { get { return datum.x; } } + public double right { get { return datum.x + width; } } + public double top { get { return datum.y; } } + public double bottom { get { return datum.y + height; } } + public double getLeft() { return left; } + public double getRight() { return right; } + public double getTop() { return top; } + public double getBottom() { return bottom; } + }