473,769 Members | 4,314 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Visua lBasic.Compatib ility.VB6.Suppo rt.IPictureDisp ToImage(page_1. Picture);
//Method 2 (Shouldn't work -- the picture property is
a metafile)
//System.IntPtr sdf = new
System.IntPtr(p age_1.Picture.H andle);
//pdf_image = Bitmap.FromHbit map(sdf);
//Method 3
//pdf_image =
AxImageConverte r.IPictureToIma ge((stdole.StdP icture) page_1.Picture) ;
//Method 4
//Graphics g =
System.Drawing. Graphics.FromIm age(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.0 F));

//Works with thumbnail :-S. BLAH!
pdf_image =
AxImageConverte r.IPictureToIma ge((stdole.StdP icture)page_1.g et_Thumbnail(Mi THUMBNAIL_SIZE. miTHUMB_SIZE_LA RGE));

-----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_Thumb nail works like a charm). Has anyone
gotten this to work in .NET?

SigmaX

May 23 '07 #1
0 1806

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

Similar topics

7
3395
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 Knowledge base has very little on the STDPicture object. Does anyone know if there is a build-in limitation that prevents you from passing this type of object? If so, is there a work around method I've missed? If anyone could point me toward some...
3
14431
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 contains the picturedata into my image list by using a function that converts the picturedata into what I believe is a stdpicture. The Access errors out with "invalid picture".
3
8056
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
12296
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? Sometimes the MODI rotates the image 90 degrees and the OCR, obviously, can' t do its job. Any ideia why this is happening?
0
1967
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; the graphic is supplied as a "StdPicture" (AKA, IPictureDisp). The only way I have found to convert this to a .NET Image is: Microsoft.VisualBasic.Compatibility.VB6.IPictureDispToImage Is that the only way to accomplish this conversion? How...
0
1898
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 object type stdole.IPictureDisp, that i can transform to System.Drawing.Image with the static method System.Drawing.Image.FromHbitmap, when step the Picture property of the same form gives an error me of type exception
1
8902
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 been shortened). Here is the code I am using: -- BEGIN CODE -- public class OCRUtil : IDisposable { const string FILENAME = "myFile.tif"; private MODI.Document doc = null;
1
2080
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 ActiveXcontrol. Please ensure it is properly registered" What is the problem? I want to use the MODI viewer to show tiff file, please help
2
4824
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 take the path and filename information passed to the form (via the form's opening arguements) and display the file in the MODI Viewer Control object. I'm using the following code to do this: Private Sub Form_Open(Cancel As Integer) Dim miDOC As...
0
9579
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10208
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9987
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8863
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.