Skip to main content

Overview

Beyond basic color and style modifications, Dear ImGui provides powerful customization capabilities including DPI scaling, custom rendering, and advanced theming techniques.

DPI Scaling

Font Scaling

Since v1.92 (June 2025), fonts may be dynamically used at any size. Select default size:
Scale all fonts:
Change font size dynamically:
Change font and font size:

Style Scaling

Style scaling is still work in progress. Expect changes in future releases.
For single viewport applications, you can scale all sizes once:
If you need to change the scaling factor, reset the style and call ScaleAllSizes() again with a new value.

DPI-Aware Windows Applications

On Windows, you must inform the OS that your application is DPI aware:
Pass SDL_WINDOW_ALLOW_HIGHDPI flag to SDL_CreateWindow() and call ::SetProcessDPIAware().
Pass SDL_WINDOW_HIGH_PIXEL_DENSITY flag to SDL_CreateWindow().
DPI awareness is handled automatically by GLFW.
Use ImGui_ImplWin32_EnableDpiAwareness() helper or an application manifest file.

Conditional Styling

Apply different styles based on widget state:

Style Stack Management

Use a counter to manage complex push/pop sequences:

Custom Widget Appearance

Invisible Buttons

Create clickable areas without visual button appearance:

Borderless Windows

Custom Colors and Themes

Creating a Custom Theme

Theme Selector

Using Reference Values

Avoid hardcoded sizes by using reference values:

Custom Rendering

For complete control over appearance, use the low-level ImDrawList API:

Anti-Aliasing Options

Control rendering quality:
Disabling anti-aliasing can improve performance on resource-constrained systems.

Style Persistence

Save and load custom styles:

Debug and Development

Style Editor

Use the built-in editor during development:

Style Selector

Quickly switch between built-in themes:

Getting Style Colors

Retrieve current color values:

Performance Considerations

See Also