LoadFromFile() 공개 정적인 메소드

public static LoadFromFile ( string filename ) : Image
filename string
리턴 Image
예제 #1
0
        public ISurface CreateSurface(string filename, bool warnOnDispose = true)
        {
            Image img = Image.LoadFromFile(filename);

            return(CreateSurface(img.Width, img.Height, img, warnOnDispose));
        }
예제 #2
0
        public void SetCursorForTool(DrawTool tool)
        {
            string cursorStr = null;

            Gdk.Cursor cursor = null;

            switch (tool)
            {
            case DrawTool.Line:
                cursorStr = "arrow";
                break;

            case DrawTool.Cross:
                cursorStr = "cross";
                break;

            case DrawTool.Text:
                cursorStr = "text";
                break;

            case DrawTool.Counter:
                cursorStr = "number";
                break;

            case DrawTool.Ellipse:
            case DrawTool.CircleArea:
                cursorStr = "ellipse";
                break;

            case DrawTool.Rectangle:
            case DrawTool.RectangleArea:
                cursorStr = "rect";
                break;

            case DrawTool.Angle:
                cursorStr = "angle";
                break;

            case DrawTool.Pen:
                cursorStr = "freehand";
                break;

            case DrawTool.Eraser:
                cursorStr = "eraser";
                break;

            case DrawTool.Player:
                cursorStr = "player";
                break;

            case DrawTool.Zoom:
                cursorStr = "zoom";
                break;

            case DrawTool.CanMove:
                cursorStr = "hand_opened";
                break;

            case DrawTool.Move:
                cursorStr = "hand_closed";
                break;

            case DrawTool.Selection:
                cursorStr = "hand_select";
                break;

            default:
                cursor = null;
                break;
            }
            if (cursorStr == null)
            {
                widget.GdkWindow.Cursor = cursor;
            }
            else
            {
                Image  img = Image.LoadFromFile(Path.Combine(Config.ImagesDir, "cursors", cursorStr));
                Cursor c   = new Cursor(widget.Display, img.Value, 0, 0);
                widget.GdkWindow.Cursor = c;
            }
        }