找回密码
 加入
搜索
楼主: jycel

[已解决]GUICtrlCreateEdit中能否插入图像?

[复制链接]
 楼主| 发表于 2009-10-17 13:06:33 | 显示全部楼层
单独使用已解决,应用到其它中还有点小小问题,继续研究

#include <GuiRichEdit.au3>
#include <GuiMenu.au3>
#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $hRichEdit, $mnu, $mnuUndo, $mnuRedo, $mnuCut, $mnuCopy
Global $mnuPaste, $mnuPasteSpl, $mnuPasteSplRTF, $mnuPasteSplwObjs
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 454, 192, 114)
$hRichEdit = _GUICtrlRichEdit_Create($Form1,""& @CR, 8, 8, 617, 369,BitOR($ES_MULTILINE, $WS_VSCROLL,$ES_READONLY, $ES_AUTOVSCROLL))
;_GUICtrlRichEdit_AppendText($hRichEdit, ReadBmpToRtf(FindFirstBMP(@ScriptDir)) & @CR)
$Button1 = GUICtrlCreateButton("Button1", 248, 416, 113, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                case $Button1
                        _GUICtrlRichEdit_AppendText($hRichEdit, ReadBmpToRtf(FindFirstBMP(@ScriptDir)) & @CR)
        EndSwitch
WEnd

Func ReadBmpToRtf($sBmpFilspc)
        Local $hFile, $sRtf
        $hFile = FileOpen($sBmpFilspc, 16)
        If FileRead($hFile, 2) <> "0x424D" Then Return SetError(1, 0, "")
        FileRead($hFile, 12)
        $sRtf = '{\rtf1{\pict\dibitmap ' & Hex(FileRead($hFile)) & '}}'
        FileClose($hFile)
        Return $sRtf
EndFunc   ;==>ReadBmpToRtf

Func FindFirstBMP($sPath);@WindowsDir)
        Local $hFind, $sBmpFilspc
        $hFind = FileFindFirstFile($sPath& "\send.bmp")
        $sBmpFilspc = FileFindNextFile($hFind)
        FileClose($hFind)
        Return $sPath & "\" & $sBmpFilspc
EndFunc   ;==>FindFirstBMP
发表于 2010-4-16 20:31:17 | 显示全部楼层
bing614  你提供的 地址   测试了下
显示图片 文字 都很好

就是 在结束的时候 内存不能释放 CPU 很高
发表于 2010-4-16 20:35:47 | 显示全部楼层
16 楼的 例子 剥离的很好

但 关闭时  内存 CPU 都没释放啊

请问 压缩包里面的 MemoryDll.au3  是不是 释放的
发表于 2012-10-2 09:03:44 | 显示全部楼层
怎么才能使用gif播放动画呢 找不到头绪哇
发表于 2012-10-2 09:03:55 | 显示全部楼层
怎么才能使用gif播放动画呢 找不到头绪哇
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-29 23:29 , Processed in 0.075933 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表