Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2007

Tip: Looking for answers? Try searching our database.

EnhMetaFileBits

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rama - 28 Mar 2007 01:07 GMT
Hi,
 I'm copying an image using the following code(EnhMetaFileBits  concept).
My problem here is I cant get the original size of the image whne I copy the
picture. is there anyway to get the original size of the picture?

Public Sub SaveImage()
       Dim ImageStream As Object
       Set ImageStream = CreateObject("ADODB.Stream")
       With ImageStream
           .Type = 1 ' adTypeBinary
           .Open
           .Write (Selection.EnhMetaFileBits)
           .SaveToFile ("C:\Imagejan077.bmp")
           .Close
       End With
       Set ImageStream = Nothing
    End Sub
I've searched the web and found that if i convert the bytes to metafile
format I can use drawing concepts of the metafile to get the size but I'm not
expert on drawing(namespace) and its usage.

// Create a meta file using the byte array returned from EnhMetaFileBits
byte[] emfData = (byte[])wdApp.Selection.EnhMetaFileBits;
System.IO.MemoryStream ms = new System.IO.MemoryStream(emfData);
Metafile mf = new Metafile(ms);
Signature

Cheers,
Rama

Rama - 28 Mar 2007 01:12 GMT
Any possible solutions ??
Signature

Cheers,
Rama

> Hi,
>   I'm copying an image using the following code(EnhMetaFileBits  concept).
[quoted text clipped - 21 lines]
> System.IO.MemoryStream ms = new System.IO.MemoryStream(emfData);
> Metafile mf = new Metafile(ms);
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.