ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving a Worksheet Shape as a Graphic File ! (https://www.excelbanter.com/excel-programming/329791-saving-worksheet-shape-graphic-file.html)

RAFAAJ2000[_2_]

Saving a Worksheet Shape as a Graphic File !
 
Hi,

Any idea how I can programatically save to disc an embeeded Shape in a
WorkSheet as a graphic bitmap file ?

Regards.

keepITcool

Saving a Worksheet Shape as a Graphic File !
 


have you seen Stephen Bullen's Paste picture example?
http://www.oaltd.co.uk/DLCount/DLCou...stePicture.zip

for a shape..
use shape's CopyPicture to put it in the clipboard

use pastepicture to retrieve the clipboard data into
an ole IPICTURE

use OLE Automation (stdole)'s SavePicure function
to save the IPICTURE to disk.







--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


RAFAAJ2000 wrote :

Hi,

Any idea how I can programatically save to disc an embeeded Shape in
a WorkSheet as a graphic bitmap file ?

Regards.


RAFAAJ2000[_2_]

Saving a Worksheet Shape as a Graphic File !
 
Wow, that's relly cool :)

Although I don't really understand the role of the IID_IDispatch UDT
variable.


'Create the interface GUID for the picture
With IID_IDispatch
.Data1 = &H7BF80980
.Data2 = &HBF32
.Data3 = &H101A
.Data4(0) = &H8B
.Data4(1) = &HBB
.Data4(2) = &H0
.Data4(3) = &HAA
.Data4(4) = &H0
.Data4(5) = &H30
.Data4(6) = &HC
.Data4(7) = &HAB
End With

Do the above Data Constantes remain always the same ?


Also, is it possible to to create a Picture via code ( from scratch) without
having to first convert an image from the ClipBoard ?

Thanks again.






"keepITcool" wrote:



have you seen Stephen Bullen's Paste picture example?
http://www.oaltd.co.uk/DLCount/DLCou...stePicture.zip

for a shape..
use shape's CopyPicture to put it in the clipboard

use pastepicture to retrieve the clipboard data into
an ole IPICTURE

use OLE Automation (stdole)'s SavePicure function
to save the IPICTURE to disk.







--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


RAFAAJ2000 wrote :

Hi,

Any idea how I can programatically save to disc an embeeded Shape in
a WorkSheet as a graphic bitmap file ?

Regards.



keepITcool

Saving a Worksheet Shape as a Graphic File !
 

it's an ID so what's surprising about it being a constant?



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


RAFAAJ2000 wrote :

Wow, that's relly cool :)

Although I don't really understand the role of the IID_IDispatch
UDT variable.


'Create the interface GUID for the picture
With IID_IDispatch
.Data1 = &H7BF80980
.Data2 = &HBF32
.Data3 = &H101A
.Data4(0) = &H8B
.Data4(1) = &HBB
.Data4(2) = &H0
.Data4(3) = &HAA
.Data4(4) = &H0
.Data4(5) = &H30
.Data4(6) = &HC
.Data4(7) = &HAB
End With

Do the above Data Constantes remain always the same ?


Also, is it possible to to create a Picture via code ( from scratch)
without having to first convert an image from the ClipBoard ?

Thanks again.






"keepITcool" wrote:



have you seen Stephen Bullen's Paste picture example?
http://www.oaltd.co.uk/DLCount/DLCou...stePicture.zip

for a shape..
use shape's CopyPicture to put it in the clipboard

use pastepicture to retrieve the clipboard data into
an ole IPICTURE

use OLE Automation (stdole)'s SavePicure function
to save the IPICTURE to disk.







--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam



RAFAAJ2000 wrote :

Hi,

Any idea how I can programatically save to disc an embeeded Shape
in a WorkSheet as a graphic bitmap file ?

Regards.




All times are GMT +1. The time now is 02:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com