If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
saving preview picture
I am developing an app that uses automation to launch Visio and then stores
the saved data in a database. This involves COM, OleCreate, storage files, etc. Along with saving the complete document data, I also want to save the preview pictures separately for use in a drawing selection list. Looking at the Visio object model, I find a reference to the PreviewPicture property of the document object but this is only available for in-proc processes which is not the case here. What happens is that if I QI for IDispatch* on the document and then do a propertyget for "PreviewPicture", I get back a null interface. How do I go about accessing the preview picture and saving it to a file? Even if I manage to get IPictureDisp, that still doesn't solve the problem of saving to a file because IPictureDisp unlike IPicture does not have the SaveToFile method. -- JB |
#2
|
|||
|
|||
saving preview picture
You may wish to look at the Page.Export() method, as you can use this to
create image files for all the pages you want to. "JB" wrote in message ... I am developing an app that uses automation to launch Visio and then stores the saved data in a database. This involves COM, OleCreate, storage files, etc. Along with saving the complete document data, I also want to save the preview pictures separately for use in a drawing selection list. Looking at the Visio object model, I find a reference to the PreviewPicture property of the document object but this is only available for in-proc processes which is not the case here. What happens is that if I QI for IDispatch* on the document and then do a propertyget for "PreviewPicture", I get back a null interface. How do I go about accessing the preview picture and saving it to a file? Even if I manage to get IPictureDisp, that still doesn't solve the problem of saving to a file because IPictureDisp unlike IPicture does not have the SaveToFile method. -- JB -- David Parker Microsoft MVP (Visio) http://bvisual.spaces.live.com http://www.visualizinginformation.com |
#3
|
|||
|
|||
saving preview picture
Thanks for the reply. I happened on to the Page-Export method after posting
my question and I have gotten it to work using that. However, that leaves me with a couple more questions. First is efficiency. Since Visio has already created the preview pic as a result of the call to OleSave, it would seem that extra work is being done to create the pic again when the Export method is called. The second question is the relationhship between the Preview pic and the result of the export. Is the Preview pic always based on Page-1 or is there some merge going on when multiple pages are present? -- JB "David Parker" wrote: You may wish to look at the Page.Export() method, as you can use this to create image files for all the pages you want to. "JB" wrote in message ... I am developing an app that uses automation to launch Visio and then stores the saved data in a database. This involves COM, OleCreate, storage files, etc. Along with saving the complete document data, I also want to save the preview pictures separately for use in a drawing selection list. Looking at the Visio object model, I find a reference to the PreviewPicture property of the document object but this is only available for in-proc processes which is not the case here. What happens is that if I QI for IDispatch* on the document and then do a propertyget for "PreviewPicture", I get back a null interface. How do I go about accessing the preview picture and saving it to a file? Even if I manage to get IPictureDisp, that still doesn't solve the problem of saving to a file because IPictureDisp unlike IPicture does not have the SaveToFile method. -- JB -- David Parker Microsoft MVP (Visio) http://bvisual.spaces.live.com http://www.visualizinginformation.com |
#4
|
|||
|
|||
saving preview picture
The Save Preview picture just uses the 1st page.
Wapperdude "JB" wrote: Thanks for the reply. I happened on to the Page-Export method after posting my question and I have gotten it to work using that. However, that leaves me with a couple more questions. First is efficiency. Since Visio has already created the preview pic as a result of the call to OleSave, it would seem that extra work is being done to create the pic again when the Export method is called. The second question is the relationhship between the Preview pic and the result of the export. Is the Preview pic always based on Page-1 or is there some merge going on when multiple pages are present? -- JB "David Parker" wrote: You may wish to look at the Page.Export() method, as you can use this to create image files for all the pages you want to. "JB" wrote in message ... I am developing an app that uses automation to launch Visio and then stores the saved data in a database. This involves COM, OleCreate, storage files, etc. Along with saving the complete document data, I also want to save the preview pictures separately for use in a drawing selection list. Looking at the Visio object model, I find a reference to the PreviewPicture property of the document object but this is only available for in-proc processes which is not the case here. What happens is that if I QI for IDispatch* on the document and then do a propertyget for "PreviewPicture", I get back a null interface. How do I go about accessing the preview picture and saving it to a file? Even if I manage to get IPictureDisp, that still doesn't solve the problem of saving to a file because IPictureDisp unlike IPicture does not have the SaveToFile method. -- JB -- David Parker Microsoft MVP (Visio) http://bvisual.spaces.live.com http://www.visualizinginformation.com |
#5
|
|||
|
|||
saving preview picture
Thanks for that.
-- JB "WapperDude" wrote: The Save Preview picture just uses the 1st page. Wapperdude "JB" wrote: Thanks for the reply. I happened on to the Page-Export method after posting my question and I have gotten it to work using that. However, that leaves me with a couple more questions. First is efficiency. Since Visio has already created the preview pic as a result of the call to OleSave, it would seem that extra work is being done to create the pic again when the Export method is called. The second question is the relationhship between the Preview pic and the result of the export. Is the Preview pic always based on Page-1 or is there some merge going on when multiple pages are present? -- JB "David Parker" wrote: You may wish to look at the Page.Export() method, as you can use this to create image files for all the pages you want to. "JB" wrote in message ... I am developing an app that uses automation to launch Visio and then stores the saved data in a database. This involves COM, OleCreate, storage files, etc. Along with saving the complete document data, I also want to save the preview pictures separately for use in a drawing selection list. Looking at the Visio object model, I find a reference to the PreviewPicture property of the document object but this is only available for in-proc processes which is not the case here. What happens is that if I QI for IDispatch* on the document and then do a propertyget for "PreviewPicture", I get back a null interface. How do I go about accessing the preview picture and saving it to a file? Even if I manage to get IPictureDisp, that still doesn't solve the problem of saving to a file because IPictureDisp unlike IPicture does not have the SaveToFile method. -- JB -- David Parker Microsoft MVP (Visio) http://bvisual.spaces.live.com http://www.visualizinginformation.com |
Thread Tools | |
Display Modes | |
|
|