Posts: 262
Threads: 63
Joined: Nov 2005
Project:
Opening and or saving a bmp, jpg or gif image in a RTF dialog.
Information:
Main dialog opens and allows you to work with images just as Word or paint will allow you to.
I realize that this is a large project and I am just looking for something to get me started.
I do not know if it needs to be a RTF but in order to place text around the image I believe it needs to be.
I would like there to be some sort of binding box around the image so I can move it in the RTF.
Thank You for any help!
Posts: 12,073
Threads: 140
Joined: Dec 2002
You can edit text+images in web browser control. Open/save in html format.
Posts: 262
Threads: 63
Joined: Nov 2005
I have looked into html however I need to be able to save, open, cut, past and do much more with doc, txt, bmp, jpeg and rtf. Let’s say that I want to use your DialogWithMenu example.
Function DialogWithMenu
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str rea3
if(!ShowDialog("DialogWithMenu" &DialogWithMenu &controls 0 0 0 0 0 0 0 "dialog.ico" "DialogWithMenu")) ret
;BEGIN DIALOG
;0 "" 0x10CF0A44 0x100 0 0 294 190 "Dialog"
;3 RichEdit20A 0x54233044 0x200 0 0 294 190 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2020009 "*" ""
ret
;messages
sel message
,case WM_INITDIALOG
,
,case WM_SIZE
,RECT r; GetClientRect(hDlg &r)
,siz r.right r.bottom id(3 hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,;menu items:
,case 101 out "Open"
,case 103 out "Cut"
,case 104 out "Select All"
,case 105 out "Help"
,
,case IDOK
,case IDCANCEL
ret 1
;BEGIN MENU
;>&File
,;&Open : 101 0 0 Co
,;-
,;>&Recent
,,;Empty : 102 0 3
,,;<
,;<
;>&Edit
,;Cu&t : 103 0 0 Cx
,;-
,;Select &All : 104 0 0 Ca
,;<
;&Help : 105 0
;END MENU
I have it opening and saving Doc, text and rtf but it will not work with bmp, jpeg or any picture. I know that Word and other programs can do this I just can not seem to make QM do it.
If I am missing something simple then I am sorry but could you give me an example?
Posts: 12,073
Threads: 140
Joined: Dec 2002
Don't know how to insert pictures in rich text control. This maybe possible with later control versions.
In web browser control you can edit cut copy paste text , insert pictures and links, format text.
Posts: 262
Threads: 63
Joined: Nov 2005
Do you have an idea when you maybe able to have a control version that will work in rtf or whatever control Word uses?
Posts: 12,073
Threads: 140
Joined: Dec 2002
If you have Word installed,
Function dlg_doc_editor
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
typelib Word {00020905-0000-0000-C000-000000000046} 8.0
str controls = "3"
str ax3SHD
if(!ShowDialog("dlg_doc_editor" &dlg_doc_editor &controls 0 0 0 0 0 0 0 "" "dlg_doc_editor")) ret
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 474 335 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 474 334 "SHDocVw.WebBrowser"
;END DIALOG
;DIALOG EDITOR: "" 0x2030009 "*" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
we3._getcontrol(id(3 hDlg))
sel wParam
,case 101 ;;open
,if(!OpenSaveDialog(0 _s "doc[]*.doc[]")) ret
,we3.Navigate(_s)
,
,case 102 ;;save
,Word.Document doc=we3.Document
,doc.Save
,
,case IDOK
,case IDCANCEL
ret 1
;BEGIN MENU
;>&File
,;&Open : 101 0 0 Co
,;&Save : 102 0 0 Cs
,;<
;>&Edit
,;Empty : 201 0 1
,;<
;END MENU
Posts: 262
Threads: 63
Joined: Nov 2005
This works on my computer but it has errors witch probably have something to do with my computer. I will have to keep looking.
Thanks
|