static void Main(string[] args) { var font = new Font(FontFamily.GenericMonospace, 35); var image = DrawClass.DrawText2("Stack Overflow\r\n\tby jp2code", font, COLOR_TEXT, COLOR_BACK); image.Save("C:\\jp2code.bmp"); }
protected static void ClickScene(Scene.Scene scene, List <BaseMenu> menuList, int x, int y) { Gl.glDisable(Gl.GL_LIGHTING); Gl.glDisable(Gl.GL_TEXTURE_2D); Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT); DrawClass.Run(scene, true, menuList); byte[] pixel = new byte[3]; Gl.glReadPixels(x, scene.HEIGHT + menuList[1].HEIGHT - y, 1, 1, Gl.GL_RGB, Gl.GL_UNSIGNED_BYTE, pixel); if (pixel[0] != 0 || pixel[1] != 0 || pixel[2] != 0) { Figure selectedFigure = scene.FindFigure(pixel); if (selectedFigure != null) { scene.SelectFigure(selectedFigure); } } Gl.glEnable(Gl.GL_LIGHTING); Gl.glEnable(Gl.GL_TEXTURE_2D); }
/// <summary> /// This initiliazes the form and assigns the scroll event to the worldmap /// </summary> public WorldMapUser() { InitializeComponent(); LocalDrawClass = new DrawClass(this); _localListHandlerClass = new ListHandlerClass(this); WorldMapHandler(); ButtonHandler(); PanelHandler(); InterestingListHandler(); ControlPanelHandler(); SettingsIcon.Click += SettingsOpen; }