c++ - Fit string inside specified rectangle -
i have string needs drawn inside rectangle. the problem lies in fact string can big fit inside. how can adjust font size string can fit inside? i have read docs gdi , found nothing. still keep searching on internet, hoping find or idea of own... gdi + option too... the following code posted in response comment user jonathan potter: #include <windows.h> #include <windowsx.h> #include <commctrl.h> #include <stdio.h> // swprintf_s() #include <math.h> #include <gdiplus.h> #include <string> using namespace gdiplus; // enable visual styles #pragma comment( linker, "/manifestdependency:\"type='win32' \ name='microsoft.windows.common-controls' version='6.0.0.0' \ processorarchitecture='*' publickeytoken='6595b64144ccf1df' \ language='*'\"") // link common controls library #pragma comme...