怎样把RichEdit中编辑的东西保存成Bmp位图,也就是怎样把rtf格式转成Bmp位图?

解决方案 »

  1.   

    http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/richedit/windowlessricheditcontrols.aspThis section contains information about the programming elements used with windowless rich edit controls. The Component Object Model (COM) defines a set of interfaces to support windowless objects. Windowless objects can enter the in-place active state without having their own window, but rather use the window of their container. Consequently, a windowless object uses fewer system resources and gives better performance through faster activation and deactivation. In addition, windowless objects can be nonrectangular and transparent.
      

  2.   

    我说的意思是把RTF格式文件转换成一幅图片 楼上给的资料没有呀!
      

  3.   

    The ITextHost interface has methods that the windowless control calls to retrieve information about your window. For example, the text services object calls the TxGetDC method to retrieve a device context into which it can draw. The windowless control calls the TxNotify method to send notifications, such as the rich edit notification messages, to the text host. The text services object calls other ITextHost methods to request the text host to perform other window-related services. For example, the TxInvalidateRect method requests the text host to add a rectangle to the window's update region.A standard rich edit control has a window procedure that processes system messages and messages from your application. You can use the control's window handle to send it messages for performing text editing and other operations. But a windowless rich edit control has no window procedure to receive and process messages. Instead, it provides an ITextServices interface. To send messages to a windowless rich edit control, call the TxSendMessage method. You can use this method to send any of the rich edit messages or to pass on other messages that affect the control, such as system messages for mouse or keyboard input.You can also create the text services object as part of a COM-aggregated object. This makes it easy to aggregate the text services object with a windowless Component Object Model (COM) object. http://codeproject.com/com/cominterfacehookingpart.asp?df=100&forumid=25002&fr=26
      

  4.   

    呵呵 我还是没明白怎么做! 不如楼上的给个代码把RTF转成Bmp位图?
      

  5.   

    先hWnd为RcihEdit的窗口句柄
    HBITMAP CTextObj::CaptureWnd(HWND hWnd,LPRECT lpRect)
    {
    return hBitmap;
    }然后,
    BOOL CDdbObj::SaveBmp(HBITMAP hBitmap, CString FileName)
    {
    return TRUE;
    }