Example #1
0
 /// <summary>
 /// Creates new memory DC and bitmap of specified size and selects it into the DC.
 /// Returns false if failed.
 /// In any case deletes previous bitmap and DC.
 /// </summary>
 /// <param name="width">Width, pixels. Must be &gt; 0.</param>
 /// <param name="height">Height, pixels. Must be &gt; 0.</param>
 public bool Create(int width, int height)
 {
     if (_disposed)
     {
         throw new ObjectDisposedException(nameof(AMemoryBitmap));
     }
     using var dcs = new ScreenDC_(0);
     Attach(Api.CreateCompatibleBitmap(dcs, width, height));
     return(_bm != default);
 }
Example #2
0
    unsafe void _InitFont()
    {
        var styles = Program.Settings.edit_styles;

        //font

        var fontsMono = new List <string>();
        var fontsVar  = new List <string>();

        using (var dc = new Au.Util.ScreenDC_(0)) {
            EnumFontFamiliesEx(dc, default, (lf, tm, fontType, lParam) => {