Class Image

Class Image

Nazwa przestrzeń: Aspose.Note Zgromadzenie: Aspose.Note.dll (25.4.0)

Przedstawia obraz.

public sealed class Image : CompositeNode<loop>, ICompositeNode<loop>, ICompositeNode, IEnumerable<loop>, IEnumerable, IPageChildNode, IOutlineElementChildNode, ITaggable, INode

Inheritance

object Node CompositeNodeBase CompositeNode Image

Implements

ICompositeNode , ICompositeNode , IEnumerable , IEnumerable , IPageChildNode , IOutlineElementChildNode , ITaggable , INode

Dziedziczeni członkowie

CompositeNode.GetEnumerator() , CompositeNode.InsertChild(int, T1) , CompositeNode.InsertChildrenRange(int, IEnumerable) , CompositeNode.InsertChildrenRange(int, params Loop[]) , CompositeNode.AppendChildFirst(T1) , CompositeNode.AppendChildLast(T1) , CompositeNode.RemoveChild(T1) , CompositeNode.Accept(DocumentVisitor) , CompositeNode.GetChildNodes(NodeType) , CompositeNode.GetChildNodes() , CompositeNode.IsComposite , CompositeNode.FirstChild , CompositeNode.LastChild , CompositeNodeBase.GetChildNodes(NodeType) , CompositeNodeBase.GetChildNodes() , Node.Accept(DocumentVisitor) , Node.Document , Node.IsComposite , Node.NodeType , Node.ParentNode , Node.PreviousSibling , Node.NextSibling , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

Pokazuje, jak łączyć hiperlink do obrazu.

// The path to the documents directory.
                                                     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");

Pokaż, jak ustawić opis tekstu dla obrazu.

// The path to the documents directory.
                                                          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 = dataDir + "ImageAlternativeText_out.one";
                                                          document.Save(dataDir);

Pokaż, jak uzyskać obraz z dokumentu.

// The path to the documents directory.
                                                     string dataDir = RunExamples.GetDataDir_Images();

                                                     // Load the document into Aspose.Note.
                                                     Document oneFile = new Document(dataDir + "Aspose.one");

                                                     // Get all Image nodes
                                                     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))
                                                             {
                                                                 // Save image bytes to a file
                                                                 bitMap.Save(String.Format(dataDir + "{0}", Path.GetFileName(image.FileName)));
                                                             }
                                                         }
                                                     }</aspose.note.image></aspose.note.image>

Pokaż, jak uzyskać meta informacje obrazu.

// The path to the documents directory.
                                                     string dataDir = RunExamples.GetDataDir_Images();

                                                     // Load the document into Aspose.Note.
                                                     Document oneFile = new Document(dataDir + "Aspose.one");

                                                     // Get all Image nodes
                                                     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();
                                                     }</aspose.note.image></aspose.note.image>

Pokaż, jak dodać nowy obraz z tagem.

// The path to the documents directory.
                                               string dataDir = RunExamples.GetDataDir_Tags();

                                               // Create an object of the Document class
                                               Document doc = new Document();

                                               // Initialize Page class object
                                               Aspose.Note.Page page = new Aspose.Note.Page(doc);

                                               // Initialize Outline class object
                                               Outline outline = new Outline(doc);

                                               // Initialize OutlineElement class object
                                               OutlineElement outlineElem = new OutlineElement(doc);

                                               // Load an image
                                               Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "icon.jpg");

                                               // Insert image in the document node
                                               outlineElem.AppendChildLast(image);
                                               image.Tags.Add(NoteTag.CreateYellowStar());

                                               // Add outline element node
                                               outline.AppendChildLast(outlineElem);

                                               // Add outline node
                                               page.AppendChildLast(outline);

                                               // Add page node
                                               doc.AppendChildLast(page);

                                               // Save OneNote document
                                               dataDir = dataDir + "AddImageNodeWithTag_out.one";
                                               doc.Save(dataDir);

Pokazuje, jak dodać obraz z pliku do dokumentu z określonymi przez użytkownika właściwościami.

// The path to the documents directory.
                                                                                          string dataDir = RunExamples.GetDataDir_Images();

                                                                                          // Load document from the stream.
                                                                                          Document doc = new Document(dataDir + "Aspose.one");

                                                                                          // Get the first page of the document.
                                                                                          Aspose.Note.Page page = doc.FirstChild;

                                                                                          // Load an image from the file.
                                                                                          Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
                                                                                                                    {
                                                                                                                        // Change the image's size according to your needs (optional).
                                                                                                                        Width = 100,
                                                                                                                        Height = 100,

                                                                                                                        // Set the image's location in the page (optional).
                                                                                                                        HorizontalOffset = 100,
                                                                                                                        VerticalOffset = 400,

                                                                                                                        // Set image alignment
                                                                                                                        Alignment = HorizontalAlignment.Right
                                                                                                                    };

                                                                                          // Add the image to the page.
                                                                                          page.AppendChildLast(image);

Pokaż, jak dodać obraz z strumienia do dokumentu.

// The path to the documents directory.
                                                               string dataDir = RunExamples.GetDataDir_Images();

                                                               // Create an object of the Document class
                                                               Document doc = new Document();

                                                               // Initialize Page class object
                                                               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"))
                                                               {

                                                                   // Load the second image using the image name, extension and stream.
                                                                   Aspose.Note.Image image1 = new Aspose.Note.Image(doc, "Penguins.jpg", fs)
                                                                                                  {
                                                                                                      // Set image alignment
                                                                                                      Alignment = HorizontalAlignment.Right
                                                                                                  };

                                                                   outlineElem1.AppendChildLast(image1);
                                                               }

                                                               outline1.AppendChildLast(outlineElem1);
                                                               page.AppendChildLast(outline1);

                                                               doc.AppendChildLast(page);

                                                               // Save OneNote document
                                                               dataDir = dataDir + "BuildDocAndInsertImageUsingImageStream_out.one";
                                                               doc.Save(dataDir);

Pokaż, jak dodać obraz z pliku do dokumentu.

// The path to the documents directory.
                                                             string dataDir = RunExamples.GetDataDir_Images();

                                                             // Create an object of the Document class
                                                             Document doc = new Document();

                                                             // Initialize Page class object
                                                             Aspose.Note.Page page = new Aspose.Note.Page(doc);

                                                             // Initialize Outline class object and set offset properties
                                                             Outline outline = new Outline(doc);

                                                             // Initialize OutlineElement class object
                                                             OutlineElement outlineElem = new OutlineElement(doc);

                                                             // Load an image by the file path.
                                                             Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
                                                                                       {
                                                                                           // Set image alignment
                                                                                           Alignment = HorizontalAlignment.Right
                                                                                       };

                                                             // Add image
                                                             outlineElem.AppendChildLast(image);

                                                             // Add outline elements
                                                             outline.AppendChildLast(outlineElem);

                                                             // Add Outline node
                                                             page.AppendChildLast(outline);

                                                             // Add Page node
                                                             doc.AppendChildLast(page);

                                                             // Save OneNote document
                                                             dataDir = dataDir + "BuildDocAndInsertImage_out.one";
                                                             doc.Save(dataDir);

Constructors

Image(strumień)

Inicjalizuje nową instancję klasy obrazu Aspose.Note.

public Image(string path)

Parameters

path string

Strumień, który zawiera ścieżkę do pliku, z którego można utworzyć Aspose.Note.Image.

Image(String, String i String)

Inicjalizuje nową instancję klasy obrazu Aspose.Note.

public Image(string path, string altTitle = null, string altDescription = null)

Parameters

path string

Strumień, który zawiera ścieżkę do pliku, z którego można utworzyć Aspose.Note.Image.

altTitle string

Alternatywny tytuł.

altDescription string

Opis alternatywny.

Image(strumień, strumień)

Inicjalizuje nową instancję klasy obrazu Aspose.Note.

public Image(string fileName, Stream imageStream)

Parameters

fileName string

Imię i nazwisko obrazu.

imageStream Stream

Strumień, który zawiera obraz.

Image()

Inicjalizuje nową instancję klasy obrazu Aspose.Note.

public Image()

Properties

Alignment

Dostęp lub ustawienie dostosowania.

public HorizontalAlignment Alignment { get; set; }

Wartość nieruchomości

HorizontalAlignment

Examples

Pokazuje, jak dodać obraz z pliku do dokumentu z określonymi przez użytkownika właściwościami.

// The path to the documents directory.
                                                                                          string dataDir = RunExamples.GetDataDir_Images();

                                                                                          // Load document from the stream.
                                                                                          Document doc = new Document(dataDir + "Aspose.one");

                                                                                          // Get the first page of the document.
                                                                                          Aspose.Note.Page page = doc.FirstChild;

                                                                                          // Load an image from the file.
                                                                                          Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
                                                                                                                    {
                                                                                                                        // Change the image's size according to your needs (optional).
                                                                                                                        Width = 100,
                                                                                                                        Height = 100,

                                                                                                                        // Set the image's location in the page (optional).
                                                                                                                        HorizontalOffset = 100,
                                                                                                                        VerticalOffset = 400,

                                                                                                                        // Set image alignment
                                                                                                                        Alignment = HorizontalAlignment.Right
                                                                                                                    };

                                                                                          // Add the image to the page.
                                                                                          page.AppendChildLast(image);

Pokaż, jak dodać obraz z strumienia do dokumentu.

// The path to the documents directory.
                                                               string dataDir = RunExamples.GetDataDir_Images();

                                                               // Create an object of the Document class
                                                               Document doc = new Document();

                                                               // Initialize Page class object
                                                               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"))
                                                               {

                                                                   // Load the second image using the image name, extension and stream.
                                                                   Aspose.Note.Image image1 = new Aspose.Note.Image(doc, "Penguins.jpg", fs)
                                                                                                  {
                                                                                                      // Set image alignment
                                                                                                      Alignment = HorizontalAlignment.Right
                                                                                                  };

                                                                   outlineElem1.AppendChildLast(image1);
                                                               }

                                                               outline1.AppendChildLast(outlineElem1);
                                                               page.AppendChildLast(outline1);

                                                               doc.AppendChildLast(page);

                                                               // Save OneNote document
                                                               dataDir = dataDir + "BuildDocAndInsertImageUsingImageStream_out.one";
                                                               doc.Save(dataDir);

Pokaż, jak dodać obraz z pliku do dokumentu.

// The path to the documents directory.
                                                             string dataDir = RunExamples.GetDataDir_Images();

                                                             // Create an object of the Document class
                                                             Document doc = new Document();

                                                             // Initialize Page class object
                                                             Aspose.Note.Page page = new Aspose.Note.Page(doc);

                                                             // Initialize Outline class object and set offset properties
                                                             Outline outline = new Outline(doc);

                                                             // Initialize OutlineElement class object
                                                             OutlineElement outlineElem = new OutlineElement(doc);

                                                             // Load an image by the file path.
                                                             Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
                                                                                       {
                                                                                           // Set image alignment
                                                                                           Alignment = HorizontalAlignment.Right
                                                                                       };

                                                             // Add image
                                                             outlineElem.AppendChildLast(image);

                                                             // Add outline elements
                                                             outline.AppendChildLast(outlineElem);

                                                             // Add Outline node
                                                             page.AppendChildLast(outline);

                                                             // Add Page node
                                                             doc.AppendChildLast(page);

                                                             // Save OneNote document
                                                             dataDir = dataDir + "BuildDocAndInsertImage_out.one";
                                                             doc.Save(dataDir);

AlternativeTextDescription

Otrzymuje lub ustawia ciało alternatywnym tekstem dla obrazu.

public string AlternativeTextDescription { get; set; }

Wartość nieruchomości

string

Examples

Pokaż, jak ustawić opis tekstu dla obrazu.

// The path to the documents directory.
                                                          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 = dataDir + "ImageAlternativeText_out.one";
                                                          document.Save(dataDir);

AlternativeTextTitle

Otrzymuje lub ustawia tytuł alternatywnego tekstu dla obrazu.

public string AlternativeTextTitle { get; set; }

Wartość nieruchomości

string

Examples

Pokaż, jak ustawić opis tekstu dla obrazu.

// The path to the documents directory.
                                                          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 = dataDir + "ImageAlternativeText_out.one";
                                                          document.Save(dataDir);

Bytes

Dostęp do magazynu danych obrazu.

public byte[] Bytes { get; }

Wartość nieruchomości

byte [ ]

Examples

Pokaż, jak uzyskać obraz z dokumentu.

// The path to the documents directory.
                                                     string dataDir = RunExamples.GetDataDir_Images();

                                                     // Load the document into Aspose.Note.
                                                     Document oneFile = new Document(dataDir + "Aspose.one");

                                                     // Get all Image nodes
                                                     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))
                                                             {
                                                                 // Save image bytes to a file
                                                                 bitMap.Save(String.Format(dataDir + "{0}", Path.GetFileName(image.FileName)));
                                                             }
                                                         }
                                                     }</aspose.note.image></aspose.note.image>

FileName

Otrzymuje nazwę pliku.

public string FileName { get; }

Wartość nieruchomości

string

Examples

Pokaż, jak uzyskać meta informacje obrazu.

// The path to the documents directory.
                                                     string dataDir = RunExamples.GetDataDir_Images();

                                                     // Load the document into Aspose.Note.
                                                     Document oneFile = new Document(dataDir + "Aspose.one");

                                                     // Get all Image nodes
                                                     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();
                                                     }</aspose.note.image></aspose.note.image>

FilePath

Dostaje drogę do pliku obrazu.

public string FilePath { get; }

Wartość nieruchomości

string

Format

Dostęp do formatu obrazu.

public ImageFormat Format { get; }

Wartość nieruchomości

ImageFormat

Height

To jest prawdziwa wysokość obrazu w dokumencie MS OneNote.

public float Height { get; set; }

Wartość nieruchomości

float

Examples

Pokaż, jak uzyskać meta informacje obrazu.

// The path to the documents directory.
                                                     string dataDir = RunExamples.GetDataDir_Images();

                                                     // Load the document into Aspose.Note.
                                                     Document oneFile = new Document(dataDir + "Aspose.one");

                                                     // Get all Image nodes
                                                     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();
                                                     }</aspose.note.image></aspose.note.image>

Pokazuje, jak dodać obraz z pliku do dokumentu z określonymi przez użytkownika właściwościami.

// The path to the documents directory.
                                                                                          string dataDir = RunExamples.GetDataDir_Images();

                                                                                          // Load document from the stream.
                                                                                          Document doc = new Document(dataDir + "Aspose.one");

                                                                                          // Get the first page of the document.
                                                                                          Aspose.Note.Page page = doc.FirstChild;

                                                                                          // Load an image from the file.
                                                                                          Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
                                                                                                                    {
                                                                                                                        // Change the image's size according to your needs (optional).
                                                                                                                        Width = 100,
                                                                                                                        Height = 100,

                                                                                                                        // Set the image's location in the page (optional).
                                                                                                                        HorizontalOffset = 100,
                                                                                                                        VerticalOffset = 400,

                                                                                                                        // Set image alignment
                                                                                                                        Alignment = HorizontalAlignment.Right
                                                                                                                    };

                                                                                          // Add the image to the page.
                                                                                          page.AppendChildLast(image);

HorizontalOffset

Zostaw lub ustaw horyzontalny odsetek.

public float HorizontalOffset { get; set; }

Wartość nieruchomości

float

Examples

Pokazuje, jak dodać obraz z pliku do dokumentu z określonymi przez użytkownika właściwościami.

// The path to the documents directory.
                                                                                          string dataDir = RunExamples.GetDataDir_Images();

                                                                                          // Load document from the stream.
                                                                                          Document doc = new Document(dataDir + "Aspose.one");

                                                                                          // Get the first page of the document.
                                                                                          Aspose.Note.Page page = doc.FirstChild;

                                                                                          // Load an image from the file.
                                                                                          Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
                                                                                                                    {
                                                                                                                        // Change the image's size according to your needs (optional).
                                                                                                                        Width = 100,
                                                                                                                        Height = 100,

                                                                                                                        // Set the image's location in the page (optional).
                                                                                                                        HorizontalOffset = 100,
                                                                                                                        VerticalOffset = 400,

                                                                                                                        // Set image alignment
                                                                                                                        Alignment = HorizontalAlignment.Right
                                                                                                                    };

                                                                                          // Add the image to the page.
                                                                                          page.AppendChildLast(image);

HyperlinkUrl

Otrzymuje lub ustawia hiperłączenie powiązane z obrazem.

public string HyperlinkUrl { get; set; }

Wartość nieruchomości

string

Examples

Pokazuje, jak łączyć hiperlink do obrazu.

// The path to the documents directory.
                                                     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

Dowiedz się, czy obraz jest obrazem tła.

public bool IsBackground { get; set; }

Wartość nieruchomości

bool

LastModifiedTime

Otrzymuje lub ustawia ostatnio zmieniony czas.

public DateTime LastModifiedTime { get; set; }

Wartość nieruchomości

DateTime

Examples

Pokaż, jak uzyskać meta informacje obrazu.

// The path to the documents directory.
                                                     string dataDir = RunExamples.GetDataDir_Images();

                                                     // Load the document into Aspose.Note.
                                                     Document oneFile = new Document(dataDir + "Aspose.one");

                                                     // Get all Image nodes
                                                     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();
                                                     }</aspose.note.image></aspose.note.image>

OriginalHeight

To jest oryginalna szerokość obrazu, przed odtworzeniem.

public float OriginalHeight { get; }

Wartość nieruchomości

float

Examples

Pokaż, jak uzyskać meta informacje obrazu.

// The path to the documents directory.
                                                     string dataDir = RunExamples.GetDataDir_Images();

                                                     // Load the document into Aspose.Note.
                                                     Document oneFile = new Document(dataDir + "Aspose.one");

                                                     // Get all Image nodes
                                                     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();
                                                     }</aspose.note.image></aspose.note.image>

OriginalWidth

To jest oryginalna szerokość obrazu, przed odtworzeniem.

public float OriginalWidth { get; }

Wartość nieruchomości

float

Examples

Pokaż, jak uzyskać meta informacje obrazu.

// The path to the documents directory.
                                                     string dataDir = RunExamples.GetDataDir_Images();

                                                     // Load the document into Aspose.Note.
                                                     Document oneFile = new Document(dataDir + "Aspose.one");

                                                     // Get all Image nodes
                                                     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();
                                                     }</aspose.note.image></aspose.note.image>

Tags

Otrzymuje listę wszystkich etykiet paragrafu.

public List<itag> Tags { get; }

Wartość nieruchomości

List • < ITag >

Examples

Pokaż, jak dodać nowy obraz z tagem.

// The path to the documents directory.
                                               string dataDir = RunExamples.GetDataDir_Tags();

                                               // Create an object of the Document class
                                               Document doc = new Document();

                                               // Initialize Page class object
                                               Aspose.Note.Page page = new Aspose.Note.Page(doc);

                                               // Initialize Outline class object
                                               Outline outline = new Outline(doc);

                                               // Initialize OutlineElement class object
                                               OutlineElement outlineElem = new OutlineElement(doc);

                                               // Load an image
                                               Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "icon.jpg");

                                               // Insert image in the document node
                                               outlineElem.AppendChildLast(image);
                                               image.Tags.Add(NoteTag.CreateYellowStar());

                                               // Add outline element node
                                               outline.AppendChildLast(outlineElem);

                                               // Add outline node
                                               page.AppendChildLast(outline);

                                               // Add page node
                                               doc.AppendChildLast(page);

                                               // Save OneNote document
                                               dataDir = dataDir + "AddImageNodeWithTag_out.one";
                                               doc.Save(dataDir);

VerticalOffset

Uzyskuje lub ustawia opłatę pionową.

public float VerticalOffset { get; set; }

Wartość nieruchomości

float

Examples

Pokazuje, jak dodać obraz z pliku do dokumentu z określonymi przez użytkownika właściwościami.

// The path to the documents directory.
                                                                                          string dataDir = RunExamples.GetDataDir_Images();

                                                                                          // Load document from the stream.
                                                                                          Document doc = new Document(dataDir + "Aspose.one");

                                                                                          // Get the first page of the document.
                                                                                          Aspose.Note.Page page = doc.FirstChild;

                                                                                          // Load an image from the file.
                                                                                          Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
                                                                                                                    {
                                                                                                                        // Change the image's size according to your needs (optional).
                                                                                                                        Width = 100,
                                                                                                                        Height = 100,

                                                                                                                        // Set the image's location in the page (optional).
                                                                                                                        HorizontalOffset = 100,
                                                                                                                        VerticalOffset = 400,

                                                                                                                        // Set image alignment
                                                                                                                        Alignment = HorizontalAlignment.Right
                                                                                                                    };

                                                                                          // Add the image to the page.
                                                                                          page.AppendChildLast(image);

Width

To jest prawdziwa szerokość obrazu w dokumencie MS OneNote.

public float Width { get; set; }

Wartość nieruchomości

float

Examples

Pokaż, jak uzyskać meta informacje obrazu.

// The path to the documents directory.
                                                     string dataDir = RunExamples.GetDataDir_Images();

                                                     // Load the document into Aspose.Note.
                                                     Document oneFile = new Document(dataDir + "Aspose.one");

                                                     // Get all Image nodes
                                                     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();
                                                     }</aspose.note.image></aspose.note.image>

Pokazuje, jak dodać obraz z pliku do dokumentu z określonymi przez użytkownika właściwościami.

// The path to the documents directory.
                                                                                          string dataDir = RunExamples.GetDataDir_Images();

                                                                                          // Load document from the stream.
                                                                                          Document doc = new Document(dataDir + "Aspose.one");

                                                                                          // Get the first page of the document.
                                                                                          Aspose.Note.Page page = doc.FirstChild;

                                                                                          // Load an image from the file.
                                                                                          Aspose.Note.Image image = new Aspose.Note.Image(doc, dataDir + "image.jpg")
                                                                                                                    {
                                                                                                                        // Change the image's size according to your needs (optional).
                                                                                                                        Width = 100,
                                                                                                                        Height = 100,

                                                                                                                        // Set the image's location in the page (optional).
                                                                                                                        HorizontalOffset = 100,
                                                                                                                        VerticalOffset = 400,

                                                                                                                        // Set image alignment
                                                                                                                        Alignment = HorizontalAlignment.Right
                                                                                                                    };

                                                                                          // Add the image to the page.
                                                                                          page.AppendChildLast(image);

Methods

Accept(DocumentVisitor)

Przyjmuje odwiedzającego węzła.

public override void Accept(DocumentVisitor visitor)

Parameters

visitor DocumentVisitor

Obiekt klasy pochodzi z Aspose.Note.DocumentVisitor.

Replace(Image)

Zastępuje aktualne dane obrazu z danymi z przedmiotu Obraz.

public void Replace(Image newImage)

Parameters

newImage Image

Obiekt obrazu zawierający nowe dane.

 Polski