public static void Main() { FleuxSettings.InertiaMode = FleuxSettings.InertiaModeOptions.Physics2x; FleuxSettings.HapticFeedbackMode = FleuxSettings.HapticOptions.Tap; FleuxApplication.TargetDesignDpi = 192; // Default HTC HD2 Res! FleuxApplication.Run(new SplashScreen()); }
protected virtual void CreateGraphicBuffers() { if (this.offBmp != null) { this.ReleaseGraphicBuffers(); } this.controlGr = CreateGraphics(); if (Height > 0 && Width > 0) { if (this.offBmp == null) { if (this.controlGr == null) { this.controlGr = CreateGraphics(); } this.offBmp = new Bitmap(Width, Height); this.offGr = Graphics.FromImage(this.offBmp); FleuxApplication.ApplyGraphicsSettings(this.offGr); this.offUpdated = false; } } }
public ClipBuffer GetOpaqueClipBuffer(Rectangle region, Bitmap bitmap) { var gr = Graphics.FromImage(bitmap); var realRegion = this.CalculateRect(region); gr.DrawImage(this.canvasImage, 0, 0, realRegion, GraphicsUnit.Pixel); FleuxApplication.ApplyGraphicsSettings(gr); return(new ClipBuffer(bitmap, gr, realRegion, this.Graphics)); }
public ClipBuffer GetClipBuffer(Rectangle region, Bitmap bitmap) { var gr = Graphics.FromImage(bitmap); var realRegion = this.CalculateRect(region); #if WINCE || WIN32 gr.DrawImage(this.canvasImage, 0, 0, realRegion, GraphicsUnit.Pixel); #else gr.Clear(System.Drawing.Color.Transparent); // win32 gdi draws text badly on transparent images ;( #endif FleuxApplication.ApplyGraphicsSettings(gr); return(new ClipBuffer(bitmap, gr, realRegion, this.Graphics)); }
public IDrawingGraphics DrawText(string text) { this.Graphics.DrawString(text, this.state.CurrenFont, this.state.CurrentBrush, this.CalculateX(this.state.CurrentX), this.CalculateY(this.state.CurrentY)); var measure = this.Graphics.MeasureString(text, this.state.CurrenFont); this.state.CurrentX += FleuxApplication.ScaleToLogic((int)measure.Width); this.ValidateExtends(this.CalculateX(this.state.CurrentX), this.CalculateY(this.state.CurrentY) + (int)measure.Height); return(this); }
public static void Run(string homepage) { while (ReloadUI) { try{ ReloadUI = false; Thread main = new Thread(() => { try{ FleuxPage home = (FleuxPage)Assembly.GetExecutingAssembly().CreateInstance(homepage); FleuxApplication.Run(home); home.Dispose(); }catch (Exception e) { Logger.error("HOBD", "fatal UI thread failure, exiting", e); } }); main.Start(); main.Join(); }catch (Exception e) { Logger.error("HOBD", "fatal failure, exiting", e); if (engine != null && engine.IsActive()) { engine.Deactivate(); } } } if (engine != null) { engine.Deactivate(); } if (Registry != null) { Registry.Deactivate(); } config.Save(); Logger.info("HOBD", "app exit"); #if !WINCE // hanged threads? Environment.Exit(0); #endif }
public IDrawingGraphics PenWidth(int width) { this.state.PenWidth = FleuxApplication.ScaleFromLogic(width); return(this); }
static void Main() { FleuxApplication.TargetDesignDpi = 192; // Default HTC HD2 Res! FleuxApplication.Run(new SplashScreen()); }
public static int ToPixels(this int logic) { return(FleuxApplication.ScaleFromLogic(logic)); }
public static int ToLogic(this int scaled) { return(FleuxApplication.ScaleToLogic(scaled)); }