Class Image
Název místa: Aspose.Note Shromáždění: Aspose.Note.dll (25.4.0)
Představuje obrázek.
public sealed class Image : CompositeNode<loop>, ICompositeNode<loop>, ICompositeNode, IEnumerable<loop>, IEnumerable, IPageChildNode, IOutlineElementChildNode, ITaggable, INode
{
}Inheritance
object
←
Node
←
CompositeNodeBase
←
CompositeNode
Implements
ICompositeNode
Dědiční členové
CompositeNode
Examples
Ukazuje, jak připojit hypertextový odkaz k obrázku.
string dataDir = RunExamples.GetDataDir_Images();
var document = new Document();
var page = new Page(document);
var image = new Image(document, dataDir + "image.jpg") { HyperlinkUrl = "http://image.com" };
page.AppendChildLast(image);
document.AppendChildLast(page);
document.Save(dataDir + "Image with Hyperlink_out.one");Ukazuje, jak nastavit popis textu pro obrázek.
string dataDir = RunExamples.GetDataDir_Images();
var document = new Document();
var page = new Page(document);
var image = new Image(document, dataDir + "image.jpg")
{
AlternativeTextTitle = "This is an image's title!",
AlternativeTextDescription = "And this is an image's description!"
};
page.AppendChildLast(image);
document.AppendChildLast(page);
dataDir += "ImageAlternativeText_out.one";
document.Save(dataDir);Ukazuje, jak získat obrázek z dokumentu.
string dataDir = RunExamples.GetDataDir_Images();
Document oneFile = new Document(dataDir + "Aspose.one");
IList<aspose.note.Image> nodes = oneFile.GetChildNodes<aspose.note.Image>();
foreach (Aspose.Note.Image image in nodes)
{
using (MemoryStream stream = new MemoryStream(image.Bytes))
{
using (Bitmap bitMap = new Bitmap(stream))
{
bitMap.Save(String.Format(dataDir + "{0}", Path.GetFileName(image.FileName)));
}
}
}Ukazuje, jak získat meta informace obrazu.
string dataDir = RunExamples.GetDataDir_Images();
Document oneFile = new Document(dataDir + "Aspose.one");
IList<aspose.note.Image> images = oneFile.GetChildNodes<aspose.note.Image>();
foreach (var image in images)
{
Console.WriteLine("Width: {0}", image.Width);
Console.WriteLine("Height: {0}", image.Height);
Console.WriteLine("OriginalWidth: {0}", image.OriginalWidth);
Console.WriteLine("OriginalHeight: {0}", image.OriginalHeight);
Console.WriteLine("FileName: {0}", image.FileName);
Console.WriteLine("LastModifiedTime: {0}", image.LastModifiedTime);
Console.WriteLine();
}Ukazuje, jak přidat nový obrázek s tagem.
string dataDir = RunExamples.GetDataDir_Tags();
Document doc = new Document();
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline = new Outline(doc);
OutlineElement outlineElem = new OutlineElement(doc);
Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "icon.jpg");
outlineElem.AppendChildLast(image);
image.Tags.Add(NoteTag.CreateYellowStar());
outline.AppendChildLast(outlineElem);
page.AppendChildLast(outline);
doc.AppendChildLast(page);
dataDir = dataDir + "AddImageNodeWithTag_out.one";
doc.Save(dataDir);Ukazuje, jak přidat obrázek z souboru do dokumentu s uživatelsky definovanými vlastnostmi.
string dataDir = RunExamples.GetDataDir_Images();
Document doc = new Document(dataDir + "Aspose.one");
Aspose.Note.Page page = doc.FirstChild;
Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
{
Width = 100,
Height = 100,
HorizontalOffset = 100,
VerticalOffset = 400,
Alignment = HorizontalAlignment.Right
};
page.AppendChildLast(image);Ukazuje, jak přidat obrázek z toku do dokumentu.
string dataDir = RunExamples.GetDataDir_Images();
Document doc = new Document();
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline1 = new Outline(doc);
OutlineElement outlineElem1 = new OutlineElement(doc);
using (FileStream fs = File.OpenRead(dataDir + "image.jpg"))
{
Aspose.Note.Image image1 = new Aspose.Note.Image(doc, "Penguins.jpg", fs)
{
Alignment = HorizontalAlignment.Right
};
outlineElem1.AppendChildLast(image1);
}
outline1.AppendChildLast(outlineElem1);
page.AppendChildLast(outline1);
doc.AppendChildLast(page);
dataDir = dataDir + "BuildDocAndInsertImageUsingImageStream_out.one";
doc.Save(dataDir);Ukazuje, jak přidat obrázek z souboru do dokumentu.
string dataDir = RunExamples.GetDataDir_Images();
Document doc = new Document();
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline = new Outline(doc);
OutlineElement outlineElem = new OutlineElement(doc);
Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
{
Alignment = HorizontalAlignment.Right
};
outlineElem.AppendChildLast(image);
outline.AppendChildLast(outlineElem);
page.AppendChildLast(outline);
doc.AppendChildLast(page);
dataDir += "BuildDocAndInsertImage_out.one";
doc.Save(dataDir);Constructors
Obrázek ( String )
Začíná nová instance Aspose.Note.Image třídy.
public Image(string path)
{
}Parameters
path string
Řetěz, který obsahuje cestu k souboru, ze kterého vytvořit Aspose.Note.Image.
Obrázek (string, string a string)
Začíná nová instance Aspose.Note.Image třídy.
public Image(string path, string altTitle = null, string altDescription = null)
{
}Parameters
path string
Řetěz, který obsahuje cestu k souboru, ze kterého vytvořit Aspose.Note.Image.
altTitle string
Alternativní název.
altDescription string
alternativní popis.
Fotografie (string a stream)
Začíná nová instance Aspose.Note.Image třídy.
public Image(string fileName, Stream imageStream)
{
}Parameters
fileName string
Jméno z obrazu.
imageStream Stream
Strom, který obsahuje obrázek.
obrázek )
Začíná nová instance Aspose.Note.Image třídy.
public Image()
{
}Properties
Alignment
Obdržíte nebo nastavíte vyrovnání.
public HorizontalAlignment Alignment
{
get;
set;
}Hodnota nemovitosti
Examples
Ukazuje, jak přidat obrázek z souboru do dokumentu s uživatelsky definovanými vlastnostmi.
string dataDir = RunExamples.GetDataDir_Images();
Document doc = new Document(dataDir + "Aspose.one");
Aspose.Note.Page page = doc.FirstChild;
Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
{
Width = 100,
Height = 100,
HorizontalOffset = 100,
VerticalOffset = 400,
Alignment = HorizontalAlignment.Right
};
page.AppendChildLast(image);Ukazuje, jak přidat obrázek z toku do dokumentu.
string dataDir = RunExamples.GetDataDir_Images();
Document doc = new Document();
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline1 = new Outline(doc);
OutlineElement outlineElem1 = new OutlineElement(doc);
using (FileStream fs = File.OpenRead(dataDir + "image.jpg"))
{
Aspose.Note.Image image1 = new Aspose.Note.Image(doc, "Penguins.jpg", fs)
{
Alignment = HorizontalAlignment.Right
};
outlineElem1.AppendChildLast(image1);
}
outline1.AppendChildLast(outlineElem1);
page.AppendChildLast(outline1);
doc.AppendChildLast(page);
dataDir = dataDir + "BuildDocAndInsertImageUsingImageStream_out.one";
doc.Save(dataDir);Ukazuje, jak přidat obrázek z souboru do dokumentu.
string dataDir = RunExamples.GetDataDir_Images();
Document doc = new Document();
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline = new Outline(doc);
OutlineElement outlineElem = new OutlineElement(doc);
Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
{
Alignment = HorizontalAlignment.Right
};
outlineElem.AppendChildLast(image);
outline.AppendChildLast(outlineElem);
page.AppendChildLast(outline);
doc.AppendChildLast(page);
dataDir = dataDir + "BuildDocAndInsertImage_out.one";
doc.Save(dataDir);AlternativeTextDescription
Obdrží nebo nastaví tělo alternativní text pro obrázek.
public string AlternativeTextDescription
{
get;
set;
}Hodnota nemovitosti
Examples
Ukazuje, jak nastavit popis textu pro obrázek.
string dataDir = RunExamples.GetDataDir_Images();
var document = new Document();
var page = new Page(document);
var image = new Image(document, dataDir + "image.jpg")
{
AlternativeTextTitle = "This is an image's title!",
AlternativeTextDescription = "And this is an image's description!"
};
page.AppendChildLast(image);
document.AppendChildLast(page);
dataDir += "ImageAlternativeText_out.one";
document.Save(dataDir);AlternativeTextTitle
Obdrží nebo nastaví název alternativního textu pro obrázek.
public string AlternativeTextTitle
{
get;
set;
}Hodnota nemovitosti
Examples
Ukazuje, jak nastavit popis textu pro obrázek.
string dataDir = RunExamples.GetDataDir_Images();
var document = new Document();
var page = new Page(document);
var image = new Image(document, dataDir + "image.jpg")
{
AlternativeTextTitle = "This is an image's title!",
AlternativeTextDescription = "And this is an image's description!"
};
page.AppendChildLast(image);
document.AppendChildLast(page);
dataDir += "ImageAlternativeText_out.one";
document.Save(dataDir);Bytes
Získejte image data store.
public byte[] Bytes
{
get;
}Hodnota nemovitosti
byte []a[]
Examples
Ukazuje, jak získat obrázek z dokumentu.
string dataDir = RunExamples.GetDataDir_Images();
Document oneFile = new Document(dataDir + "Aspose.one");
IList<aspose.note.Image> nodes = oneFile.GetChildNodes<aspose.note.Image>();
foreach (var image in nodes)
{
using (MemoryStream stream = new MemoryStream(image.Bytes))
{
using (Bitmap bitmap = new Bitmap(stream))
{
bitmap.Save(Path.Combine(dataDir, Path.GetFileName(image.FileName)));
}
}
}FileName
Dostanete název souboru.
public string FileName
{
get;
}Hodnota nemovitosti
Examples
Ukazuje, jak získat meta informace obrazu.
string dataDir = RunExamples.GetDataDir_Images();
Document oneFile = new Document(dataDir + "Aspose.one");
IList<aspose.note.Image> images = oneFile.GetChildNodes<aspose.note.Image>();
foreach (Aspose.Note.Image image in images)
{
Console.WriteLine("Width: {0}", image.Width);
Console.WriteLine("Height: {0}", image.Height);
Console.WriteLine("OriginalWidth: {0}", image.OriginalWidth);
Console.WriteLine("OriginalHeight: {0}", image.OriginalHeight);
Console.WriteLine("FileName: {0}", image.FileName);
Console.WriteLine("LastModifiedTime: {0}", image.LastModifiedTime);
Console.WriteLine();
}FilePath
Získáte cestu k obrázku souboru.
public string FilePath
{
get;
}Hodnota nemovitosti
Format
Dostane formát obrazu.
public ImageFormat Format
{
get;
}Hodnota nemovitosti
Height
To je skutečná výška obrazu v dokumentu MS OneNote.
public float Height
{
get;
set;
}Hodnota nemovitosti
Examples
Ukazuje, jak získat meta informace obrazu.
string dataDir = RunExamples.GetDataDir_Images();
Document oneFile = new Document(dataDir + "Aspose.one");
IList<aspose.note.Image> images = oneFile.GetChildNodes<aspose.note.Image>();
foreach (Aspose.Note.Image image in images)
{
Console.WriteLine("Width: {0}", image.Width);
Console.WriteLine("Height: {0}", image.Height);
Console.WriteLine("OriginalWidth: {0}", image.OriginalWidth);
Console.WriteLine("OriginalHeight: {0}", image.OriginalHeight);
Console.WriteLine("FileName: {0}", image.FileName);
Console.WriteLine("LastModifiedTime: {0}", image.LastModifiedTime);
Console.WriteLine();
}Ukazuje, jak přidat obrázek z souboru do dokumentu s uživatelsky definovanými vlastnostmi.
string dataDir = RunExamples.GetDataDir_Images();
Document doc = new Document(dataDir + "Aspose.one");
Aspose.Note.Page page = doc.FirstChild;
Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
{
Width = 100,
Height = 100,
HorizontalOffset = 100,
VerticalOffset = 400,
Alignment = HorizontalAlignment.Right
};
page.AppendChildLast(image);HorizontalOffset
Obdržíte nebo nastavte horizontální offset.
public float HorizontalOffset
{
get;
set;
}Hodnota nemovitosti
Examples
Ukazuje, jak přidat obrázek z souboru do dokumentu s uživatelsky definovanými vlastnostmi.
string dataDir = RunExamples.GetDataDir_Images();
Document doc = new Document(dataDir + "Aspose.one");
Aspose.Note.Page page = doc.FirstChild;
Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
{
Width = 100,
Height = 100,
HorizontalOffset = 100,
VerticalOffset = 400,
Alignment = HorizontalAlignment.Right
};
page.AppendChildLast(image);HyperlinkUrl
Obdržíte nebo nastavíte hypertextový odkaz spojený s obrázkem.
public string HyperlinkUrl
{
get;
set;
}Hodnota nemovitosti
Examples
Ukazuje, jak připojit hypertextový odkaz k obrázku.
string dataDir = RunExamples.GetDataDir_Images();
var document = new Document();
var page = new Page(document);
var image = new Image(document, dataDir + "image.jpg") { HyperlinkUrl = "http://image.com" };
page.AppendChildLast(image);
document.AppendChildLast(page);
document.Save(dataDir + "Image with Hyperlink_out.one");IsBackground
Zjistí, zda je obraz pozadí.
public bool IsBackground
{
get;
set;
}Hodnota nemovitosti
LastModifiedTime
Obdržíte nebo nastavíte poslední změněný čas.
public DateTime LastModifiedTime
{
get;
set;
}Hodnota nemovitosti
Examples
Ukazuje, jak získat meta informace obrazu.
string dataDir = RunExamples.GetDataDir_Images();
Aspose.Words.Document oneFile = new Aspose.Words.Document(dataDir + "Aspose.one");
IList<aspose.note.Image> images = oneFile.GetChildNodes<aspose.note.Image>();
foreach (var image in images)
{
Console.WriteLine("Width: {0}", image.Width);
Console.WriteLine("Height: {0}", image.Height);
Console.WriteLine("OriginalWidth: {0}", image.OriginalWidth);
Console.WriteLine("OriginalHeight: {0}", image.OriginalHeight);
Console.WriteLine("FileName: {0}", image.FileName);
Console.WriteLine("LastModifiedTime: {0}", image.LastModifiedTime);
Console.WriteLine();
}OriginalHeight
To je původní šířka obrazu, před resing.
public float OriginalHeight
{
get;
}Hodnota nemovitosti
Examples
Ukazuje, jak získat meta informace obrazu.
string dataDir = RunExamples.GetDataDir_Images();
Document oneFile = new Document(dataDir + "Aspose.one");
IList<aspose.note.Image> images = oneFile.GetChildNodes<aspose.note.Image>();
foreach (Aspose.Note.Image image in images)
{
Console.WriteLine("Width: {0}", image.Width);
Console.WriteLine("Height: {0}", image.Height);
Console.WriteLine("OriginalWidth: {0}", image.OriginalWidth);
Console.WriteLine("OriginalHeight: {0}", image.OriginalHeight);
Console.WriteLine("FileName: {0}", image.FileName);
Console.WriteLine("LastModifiedTime: {0}", image.LastModifiedTime);
Console.WriteLine();
}OriginalWidth
To je původní šířka obrazu, před resing.
public float OriginalWidth
{
get;
}Hodnota nemovitosti
Examples
Ukazuje, jak získat meta informace obrazu.
string dataDir = RunExamples.GetDataDir_Images();
Document oneFile = new Document(dataDir + "Aspose.one");
IList<aspose.note.Image> images = oneFile.GetChildNodes<aspose.note.Image>();
foreach (var image in images)
{
Console.WriteLine("Width: {0}", image.Width);
Console.WriteLine("Height: {0}", image.Height);
Console.WriteLine("OriginalWidth: {0}", image.OriginalWidth);
Console.WriteLine("OriginalHeight: {0}", image.OriginalHeight);
Console.WriteLine("FileName: {0}", image.FileName);
Console.WriteLine("LastModifiedTime: {0}", image.LastModifiedTime);
Console.WriteLine();
}Tags
Získáte seznam všech značek jednoho odstavce.
public List<Itag> Tags { get; }
Note that I used PascalCase for the property name (`Itag`) since it follows C# naming conventions for types. The rest of your code appears to be already following these conventions. However, in the future, please remember that consistency is key in coding practices. Happy coding!Hodnota nemovitosti
Examples
Ukazuje, jak přidat nový obrázek s tagem.
string dataDir = RunExamples.GetDataDir_Tags();
Document doc = new Document();
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline = new Outline(doc);
OutlineElement outlineElem = new OutlineElement(doc);
Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "icon.jpg");
outlineElem.AppendChildLast(image);
image.Tags.Add(NoteTag.CreateYellowStar());
outline.AppendChildLast(outlineElem);
page.AppendChildLast(outline);
doc.AppendChildLast(page);
dataDir += "AddImageNodeWithTag_out.one";
doc.Save(dataDir);VerticalOffset
Obdržíte nebo nastavte vertikální offset.
public float VerticalOffset
{
get;
set;
}Hodnota nemovitosti
Examples
Ukazuje, jak přidat obrázek z souboru do dokumentu s uživatelsky definovanými vlastnostmi.
string dataDir = RunExamples.GetDataDir_Images();
Document doc = new Document(dataDir + "Aspose.one");
Aspose.Note.Page page = doc.FirstChild;
Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
{
Width = 100,
Height = 100,
HorizontalOffset = 100,
VerticalOffset = 400,
Alignment = HorizontalAlignment.Right
};
page.AppendChildLast(image);Width
To je skutečná šířka obrazu v dokumentu MS OneNote.
public float Width
{
get;
set;
}Hodnota nemovitosti
Examples
Ukazuje, jak získat meta informace obrazu.
string dataDir = RunExamples.GetDataDir_Images();
Aspose.Words.Document oneFile = new Aspose.Words.Document(dataDir + "Aspose.one");
IList<aspose.note.Image> images = oneFile.GetChildNodes<aspose.note.Image>();
foreach (Aspose.Note.Image image in images)
{
Console.WriteLine("Width: {0}", image.Width);
Console.WriteLine("Height: {0}", image.Height);
Console.WriteLine("OriginalWidth: {0}", image.OriginalWidth);
Console.WriteLine("OriginalHeight: {0}", image.OriginalHeight);
Console.WriteLine("FileName: {0}", image.FileName);
Console.WriteLine("LastModifiedTime: {0}", image.LastModifiedTime);
Console.WriteLine();
}Ukazuje, jak přidat obrázek z souboru do dokumentu s uživatelsky definovanými vlastnostmi.
string dataDir = RunExamples.GetDataDir_Images();
Document doc = new Document(dataDir + "Aspose.one");
Aspose.Note.Page page = doc.FirstChild;
Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
{
Width = 100,
Height = 100,
HorizontalOffset = 100,
VerticalOffset = 400,
Alignment = HorizontalAlignment.Right
};
page.AppendChildLast(image);Methods
Přijímání (DocumentVisitor)
Přijímá návštěvníka nodu.
public override void Accept(Aspose.Words.DocumentVisitor visitor)
{
}Parameters
visitor DocumentVisitor
Předmět třídy je odvozen od Aspose.Note.DocumentVisitor.
Změna obrazu (Image)
nahrazuje aktuální údaje o obrazu s údaji z předloženého Objektu Obrázku.
public void Replace(Image newImage)
{
}Parameters
newImage Image
Objekt obrazu obsahující nové údaje.