473,394 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

MODI and StdPicture (Element not found)

Hey;

I'm using the Document Imagine API from Office 2003. I need to get
away from the proprietary MDI/TIFF formats it produces. It looked
pretty simple, but it's giving me grief when I try to convert the
IPictureDisp object it creates into an Image for use with .NET:

-----begin source (C#)-----
//Take page 1
MODI.Image page_1 = (MODI.Image) doc.Images[0];

//Convert it to System.Drawing.Image
//None of these methods work
System.Drawing.Image pdf_image =
System.Drawing.Image.FromFile("a.jpg");

//Method 1
//pdf_image =
Microsoft.VisualBasic.Compatibility.VB6.Support.IP ictureDispToImage(page_1.Picture);
//Method 2 (Shouldn't work -- the picture property is
a metafile)
//System.IntPtr sdf = new
System.IntPtr(page_1.Picture.Handle);
//pdf_image = Bitmap.FromHbitmap(sdf);
//Method 3
//pdf_image =
AxImageConverter.IPictureToImage((stdole.StdPictur e) page_1.Picture);
//Method 4
//Graphics g =
System.Drawing.Graphics.FromImage(pdf_image);
//IntPtr gp = g.GetHdc();
//page_1.Picture.Render((int)gp, 0, 0,
page_1.Picture.Width, page_1.Picture.Height, 0, 0,
page_1.Picture.Width, page_1.Picture.Height, (System.IntPtr)null);
//g.DrawImage(pdf_image, new PointF(0.0F,0.0F));

//Works with thumbnail :-S. BLAH!
pdf_image =
AxImageConverter.IPictureToImage((stdole.StdPictur e)page_1.get_Thumbnail(MiTHUMBNAIL_SIZE.miTHUMB_SI ZE_LARGE));

-----end source------

The error I get is "Element not found." (Same as
this post:
http://groups.google.com/group/micro...ev/browse_thre...)

So, I can only conclude, MODI's StdPicture object is corrupt for
Image.Picture, (Though
it works with *something,* i.e. the VB6 picture box, and
Image.get_Thumbnail works like a charm). Has anyone
gotten this to work in .NET?

SigmaX

May 23 '07 #1
0 1784

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Bruce A. Wilkinson | last post by:
Greetings All I am currently attempting to pass an STDPicture object to the Picture property of a class module within a DLL. However, none of the usual methods seem to apply. The Microsoft...
3
by: trojacek | last post by:
I'm trying to load image data stored in an OLE field into an image list, that will be used by a treeview to show icons. This is at run time. To do this, I'm trying to load the field which...
3
by: Metallicore | last post by:
Does anyone know how to load a vb6 stdPicture (in an existing DLL) from vb.net? System.Drawing.Image is not the same thing as stdPicture in vb6.
3
by: David de Passos | last post by:
Hi! I'm using MODI activex from Microsoft Office 2003 and Microsoft VB.NET to get the text from an OCR acquired image. Why after OCR the image, the MODI component rotate the image? ...
0
by: Mark | last post by:
We're authoring a VS 2005 app that includes several EXE's and DLL's and also uses a COM component (a customer requirement). The COM component provides a graphic image to be used by the .NET app;...
0
by: Pedro Hurtado | last post by:
I am using (Microsoft Office Document Imaging 11.0 Type Library) and I have the following problem: The method (Microsoft Office Document Imaging 11.0 Type Library) of the interface IImage me an...
1
by: Tod Birdsall | last post by:
I am using Microsoft Office Document Imaging (MODI) with great success. However, when execute the following code, I get the error "The process cannot access the file 'myFile.tif'" (File name has...
1
by: hangdee | last post by:
I am trying to use MODI (Microsoft Office Document Imaging) viewer control in my VB 2005 application. But when I drag the MODI viewer control into my form, it prompts that "Failed to import the...
2
by: sphinney | last post by:
Hi everyone. I have a form in my Access 2007 database with a Microsoft Office Document Imaging Viewer Control 12.0 object on it. The object is named "GRAPHIC_mdv". When the form opens I want to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.