================================ == Images In Rich Edit == ================================
Author: Elliott Sales de Andrade E-mail: quantum_analyst @hotmail.com
What Is It? ----------- Put simply, it's a DLL that enables you to insert bitmaps into a RichEdit Control. I made this for the Euphoria Instant Messenger and am now releasing it. You can insert bitmaps by filename, and by handle. Some code has been taken from MSDN, and other code from Code Guru. It should work, but if it doesn't please e-mail me at quantum_analyst @hotmail.com. I may eventually look at re-writing all that C/C++ code in Euphoria, but not at the moment.
Functions ---------
InsertBitmapFromFile(atom rEdit, sequence FileName, atom dwFlags) rEdit: RichEdit Control's Handle FileName: File Name of Bitmap dwFlags: Any Flags
InsertBitmapFromFile() inserts the bitmap called 'FileName' into the RichEdit Control with the handle rEdit. FileName must be an absolute path. In Win32Lib, use getHandle() to get the Handle of the RichEdit Control. dwFlags can be any of the following flags, or any number of them OR'd together. REO_NULL: No flags REO_READWRITEMASK: Mask out RO bits REO_DONTNEEDPALETTE: Object doesn't need palette REO_BLANK: Object is blank REO_DYNAMICSIZE: Object defines size always REO_INVERTEDSELECT: Object drawn all inverted if sel REO_BELOWBASELINE: Object sits below the baseline REO_RESIZABLE: Object may be resized by user For me though, half of these flags don't make a difference. REO_READWRITEMASK, REO_DONTNEEDPALETTE, REO_BLANK, and REO_DYNAMICSIZE don't seem to make a difference. REO_NULL, REO_INVERTEDSELECT, REO_BELOWBASELINE, and REO_RESIZABLE do seem to make a difference. Note: Pictures can be double-clicked and edited in Paint. It does not change the actual file, but only the image in the RichEdit Control.
InsertBitmapFromData(atom rEdit, atom hBitmap, atom dwFlags) rEdit: RichEdit Control's Handle hBitmap: Handle of Bitmap dwFlags: Any Flags
InsertBitmapFromData() inserts the bitmap from handle hBitmap in to the RichEdit Control with the handle rEdit. Use getHandle() in Win32Lib for the RichEdit Control, but you do not need to do this for the Bitmap. Flags are the same as in InsertBitmapFromFile(). Note: These images won't be editable, like when inserted by file.
NOTE:: Neither of these will work with the RichEdit Control having the flag ES_READONLY. I'm not sure why exactly, but you can't use images with this style. I'm looking in to this at the moment. An alternative would be to do: --Mario Steele -- Win32Lib Code Follows procedure NoEdit_RichEdit(integer self, integer event, sequence params) returnValue(-1) end procedure setHandler(rEdit, w32HKeyPress, routine_id("NoEdit_RichEdit")
Copyrights and Licenses =======================
InsertBitmapFromData(), © Hani Atassi 2001 InsertBitmapFromFile(), © Microsoft KB Article # 220844
All Open Source Code If you change anything that you find useful, E-mail me at: quantum_analyst @hotmail.com |