MODI ERROR

P

Pedro Hurtado

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


correct code

MODI.DocumentClass doc = new DocumentClass();
doc.Create("e:\\midoc.mdi");
MODI.IImage img= doc.Images[0] as MODI.IImage;
stdole.IPictureDisp pic =
(stdole.IPictureDisp)img.get_Thumbnail(MODI.MiTHUMBNAIL_SIZE.miTHUMB_SIZE_MEDIUM);
this.pictureBox1.Image =
System.Drawing.Image.FromHbitmap((System.IntPtr)pic.Handle,(System.IntPtr)pic.hPal);


incorrect code

MODI.DocumentClass doc = new DocumentClass();
doc.Create("e:\\midoc.mdi");
MODI.IImage img= doc.Images[0] as MODI.IImage;
stdole.IPictureDisp pic = (stdole.IPictureDisp)img.Picture;
this.pictureBox1.Image =
System.Drawing.Image.FromHbitmap((System.IntPtr)pic.Handle,(System.IntPtr)pic.hPal);

only a question:is this a library bug?

thanks


----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...=microsoft.public.office.developer.automation
 
R

Rizwan

is there any solution to this. i want to get the full picture not the
thumbnail. how can i get this.

regards
Rizwan
 
C

Chester

I had googled for hours trying to find a solution to this without avail. MS
Office folks see to be dead silent on this.
I am assuming it's an automation bug.


Rizwan said:
is there any solution to this. i want to get the full picture not the
thumbnail. how can i get this.

regards
Rizwan

Pedro Hurtado said:
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


correct code

MODI.DocumentClass doc = new DocumentClass();
doc.Create("e:\\midoc.mdi");
MODI.IImage img= doc.Images[0] as MODI.IImage;
stdole.IPictureDisp pic =
(stdole.IPictureDisp)img.get_Thumbnail(MODI.MiTHUMBNAIL_SIZE.miTHUMB_SIZE_MEDIUM);
this.pictureBox1.Image =
System.Drawing.Image.FromHbitmap((System.IntPtr)pic.Handle,(System.IntPtr)pic.hPal);


incorrect code

MODI.DocumentClass doc = new DocumentClass();
doc.Create("e:\\midoc.mdi");
MODI.IImage img= doc.Images[0] as MODI.IImage;
stdole.IPictureDisp pic = (stdole.IPictureDisp)img.Picture;
this.pictureBox1.Image =
System.Drawing.Image.FromHbitmap((System.IntPtr)pic.Handle,(System.IntPtr)pic.hPal);

only a question:is this a library bug?

thanks


----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...=microsoft.public.office.developer.automation
 
S

SSDG

I have been trying to get some help getting started with MODI. I thought
since you are already using it maybe you could help.

I do most of my programming in excel and want to access the MODI application
and its objects. I added the MODI 11.0 library and it appears in the object
browser, but I cannot get anything to respond to any code.

Is there something that needs to be done besides adding the library?
 
Top