AddOleObjectFrame
Contenido
[
Ocultar
]AddOleObjectFrame(float, float, float, float, IOleEmbeddedDataInfo)
Agrega un nuevo objeto OLE al final de una colección.
public IOleObjectFrame AddOleObjectFrame(float x, float y, float width, float height,
IOleEmbeddedDataInfo dataInfo)
Parámetro | Tipo | Descripción |
---|---|---|
x | Single | Coordenada X de un nuevo marco OLE. |
y | Single | Coordenada Y de un nuevo marco OLE. |
width | Single | Ancho de un nuevo marco OLE. |
height | Single | Altura de un nuevo marco OLE. |
dataInfo | IOleEmbeddedDataInfo | Información de datos incorporada IOleEmbeddedDataInfo . |
Valor de Retorno
Objeto OLE creado.
Ejemplos
Los siguientes ejemplos muestran cómo agregar Marcos de Objetos OLE a las Diapositivas de una Presentación de PowerPoint.
[C#]
// Instancia la clase Presentation que representa el archivo PPTX
using (Presentation pres = new Presentation())
{
// Accede a la primera diapositiva
ISlide sld = pres.Slides[0];
// Carga un archivo de Excel en un flujo
MemoryStream mstream = new MemoryStream();
using (FileStream fs = new FileStream("book1.xlsx", FileMode.Open, FileAccess.Read))
{
byte[] buf = new byte[4096];
while (true)
{
int bytesRead = fs.Read(buf, 0, buf.Length);
if (bytesRead <= 0)
break;
mstream.Write(buf, 0, bytesRead);
}
}
// Crea un objeto de datos para incrustar
IOleEmbeddedDataInfo dataInfo = new OleEmbeddedDataInfo(mstream.ToArray(), "xlsx");
// Agrega una forma de Marco de Objeto OLE
IOleObjectFrame oleObjectFrame = sld.Shapes.AddOleObjectFrame(0, 0, pres.SlideSize.Size.Width,
pres.SlideSize.Size.Height, dataInfo);
// Escribe el archivo PPTX en el disco
pres.Save("OleEmbed_out.pptx", SaveFormat.Pptx);
}
Ver También
- interface IOleObjectFrame
- interface IOleEmbeddedDataInfo
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides
AddOleObjectFrame(float, float, float, float, string, string)
Agrega un nuevo objeto OLE al final de una colección.
public IOleObjectFrame AddOleObjectFrame(float x, float y, float width, float height,
string className, string path)
Parámetro | Tipo | Descripción |
---|---|---|
x | Single | Coordenada X de un nuevo marco OLE. |
y | Single | Coordenada Y de un nuevo marco OLE. |
width | Single | Ancho de un nuevo marco OLE. |
height | Single | Altura de un nuevo marco OLE. |
className | String | Nombre de una clase OLE. |
path | String | Ruta al archivo vinculado. |
Valor de Retorno
Objeto OLE creado.
Ver También
- interface IOleObjectFrame
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides