顯示具有 Microsoft 標籤的文章。 顯示所有文章
顯示具有 Microsoft 標籤的文章。 顯示所有文章

2018年1月6日 星期六

[Word] Mac 版 Microsoft Word 中文直書


  • Problem: Mac上的 Microsoft Word, 想排版成中文直書, 但直書只看得到連字也順時針轉 90度的選項
  • Solution:
    1. 關閉 Word
    2. 設定 Microsoft Language Register到 Traditional Chinese
      1. 應用程式 -> Microsoft Word 20xx -> Additional Tools -> Microsoft Language Register
    3. 重開 Word, Layout中看到 Layout中的直書選項即可
    4. Reference: [教學]如何在Office 2004 for Mac Word 中輸入直式中文

2012年9月14日 星期五

[IE] 將 Windows 7上 IE 9降為 IE 8

最近因為當志工做翻譯, 需要測試網頁, 環境是 IE8, 不過在 Windows 7上若直接透過 Windows IE8安裝會失敗. 志工夥伴 Yi-Hsin提供了 Downgrade IE9 to IE 8的分享. 這邊就整理整理囉!

  1. 開啟控制台 
  2. 選擇 "程式和功能" 
  3. 選擇左手邊的 "檢視已安裝的更新" 
  4. 找到 Windows Internet Explorer 9 
  5. 解除安裝(需要重開機) 
  6. Done!

2012年9月10日 星期一

[DirectDraw] Notes

參考資料: MSDN DirectDraw

定義

DirectDraw為一個特殊的記憶體管理員,提供 2-D存取 Windows Graphics Device Interface (GDI)的硬體加速, 個人覺得定義最好的是下面這段
DirectDraw is a low-level application programming interface (API) for graphics. It controls memory, the hardware blitter, and surface flipping operations. DirectDraw is a software interface that provides direct access to display devices while maintaining compatibility with the Windows Embedded CE graphics device interface (GDI).
何時該用 DirectDraw? 主要是以效能考量的時候, 為了提升 GDI速度的不足。
DirectDraw主要任務:
  1. 直接存取影像記憶體(video meory), 而不是系統記憶體(system memory)
  2. Page flipping
  3. Back buffering
  4. Clipping
相關專有名詞可參考 Graphics Concept. 架構圖如下:

介面

  1. Graphics Devices
    1. 定義: The device context is a structure containing information about the device.
  2. DirectDraw Objects: IDirectDraw
    1. 互動介面: Cooperative Level
    2. 一個 DirectDraw application可區分為兩類, 一種是視窗式 (windowed), 另一種為全螢幕式 (full-screen或 exclusive), 最大的差別在前者無法實現 page flipping, 後者則能避免其他應用程式存取 surfaces與畫圖於 primary display之上。
    3. Display Mode
      1. Primary Surfaces給 monitor的硬體設定值
      2. 主要為 dimension與 depth, e.g. 800*600 pixels and 8-bit/pixel
      3. 分為兩種: palettized與 non-palettized, 調色盤每個顏色是對應到一個 index value
      4. 重要 WinCE特性:
        1. DirectDraw cannot change the display mode.
      5. 呼叫  IDirectDraw::EnumDisplayModes 可查看硬體支援的 Display mode
    4. Singleton for process
      1. 對於每個 process, directdraw 是 singleton的, 若已經存在 instance, 則 call DirectDrawCreate 仍會回原本那個 instance.
  3. DirectDraw Surfaces: IDirectDrawSurface
    1. 定義: The DirectDrawSurface object represents a surface that usually resides in the display memory, but can exist in system memory if display memory is exhausted or if it is explicitly requested.
    2. 所有 surfaces都由 DirectDraw object來 create
    3. Blt
      1. 從 source 的 surface貼到 destination
      2. Blt會自動 scale且支援內插 (interpolation)
  4. DirectDraw Clippers: IDirectDrawClipper

程式

初始化程式, 其實就宣告 DirectDraw, DirectDraw的 Surface而已, 注意 Caps代表的是 capabilities, 也就是此實作 HAL (Hardware Abstract Layer)的 chip廠提供哪些 DirectDraw的功能。

#include <ddraw.h>

HRESULT hr;
IDirectDraw * pDD = NULL;
IDirectDrawSurface * pDDSPrimary = NULL;
DDSURFACEDESC ddsd;

hr = DirectDrawCreate(NULL, &pDD, NULL);
hr = pDD->SetCooperativeLevel(hwnd, DDSCL_FULLSCREEN);
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = pDD->CreateSurface(&ddsd, &pDDSPrimary, NULL);

細節:

  1. HEL (Hardware Emulation Layer) 僅提供 8, 16, 24, 32 bpp(bit per pixel)的 Surfaces。為了避免混用 HAL, HEL反而使效能降低,建議若有使用到硬體不支援的功能時,另外建立 system memory的 Surfaces來實作 (參考: Software Emulation)