picturebox1.image into a slide

D

Dileep

hello,
My application is a stand alone application in powerpoint 2007
using c#.net 2008 and .net framework is 3.5.When my aplllication runs, it
wiil shows the add_ins(Mystudio) Tab in powerpoint 2007. In Mystudio tab,
have one button, studio.When i click on the Studio,it will launch My
windows application , it has one windows forms,it contains one picture box
and a button.The picture box is used for displaying the image .The button,
is used for apply the picturebox image into a slide.For this purpuse, i wrote
the code in Button click event,

PowerPoint.Presentation presntation = Application.ActivePresentation;
if (presntation != null)
{
MessageBox.Show("Current Presentation");
PowerPoint.Slide slide =
presntation.Slides.Add(presntation.Slides.Count + 1,
PowerPoint.PpSlideLayout.ppLayoutPictureWithCaption);
PowerPoint.Shape shape = slide.Shapes[2];
slide.Shapes.AddPicture(@"C:\Documents and Settings\User1\My
Documents\LEADTOOLS Images\eye.gif",

Microsoft.Office.Core.MsoTriState.msoFalse,
Microsoft.Office.Core.MsoTriState.msoTrue,
shape.Left, shape.Top, shape.Width,
shape.Height);
}


it si working fine, but One problem is below , here i passing the
path(@"C:\Documents and Settings\User1\My Documents\LEADTOOLS
Images\eye.gif", )

,but iwant to pass the Picturebox1.image in below code.

slide.Shapes.AddPicture(@"C:\Documents and Settings\User1\My
Documents\LEADTOOLS Images\eye.gif",

Microsoft.Office.Core.MsoTriState.msoFalse,
Microsoft.Office.Core.MsoTriState.msoTrue,
shape.Left, shape.Top, shape.Width,
shape.Height);
 
D

Dileep

Chirag said:
You can perhaps save the image to a file (Picturebox1.image.Save()) and then
call slide.Shapes.AddPicture() method with that file name.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

Dileep said:
hello,
My application is a stand alone application in powerpoint 2007
using c#.net 2008 and .net framework is 3.5.When my aplllication runs, it
wiil shows the add_ins(Mystudio) Tab in powerpoint 2007. In Mystudio tab,
have one button, studio.When i click on the Studio,it will launch My
windows application , it has one windows forms,it contains one picture box
and a button.The picture box is used for displaying the image .The
button,
is used for apply the picturebox image into a slide.For this purpuse, i
wrote
the code in Button click event,

PowerPoint.Presentation presntation = Application.ActivePresentation;
if (presntation != null)
{
MessageBox.Show("Current Presentation");
PowerPoint.Slide slide =
presntation.Slides.Add(presntation.Slides.Count + 1,
PowerPoint.PpSlideLayout.ppLayoutPictureWithCaption);
PowerPoint.Shape shape = slide.Shapes[2];
slide.Shapes.AddPicture(@"C:\Documents and
Settings\User1\My
Documents\LEADTOOLS Images\eye.gif",

Microsoft.Office.Core.MsoTriState.msoFalse,
Microsoft.Office.Core.MsoTriState.msoTrue,
shape.Left, shape.Top,
shape.Width,
shape.Height);
}


it si working fine, but One problem is below , here i passing the
path(@"C:\Documents and Settings\User1\My Documents\LEADTOOLS
Images\eye.gif", )

,but iwant to pass the Picturebox1.image in below code.

slide.Shapes.AddPicture(@"C:\Documents and Settings\User1\My
Documents\LEADTOOLS Images\eye.gif",

Microsoft.Office.Core.MsoTriState.msoFalse,
Microsoft.Office.Core.MsoTriState.msoTrue,
shape.Left, shape.Top,
shape.Width,
shape.Height);

hello,
i have to after some editing like cropping , change color
etc,then i
want the modified image and the original image.If i call
picturbox1.image.Save(),then the original image is overwritted.I want both
original image and editting image.
regard
Dileep
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top