Class Image

Class Image

اسم الفضاء : Aspose.Note تجميع: Aspose.Note.dll (25.4.0)

يمثل صورة

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

الأعضاء الموروثين

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

يظهر كيفية ربط الرابط إلى صورة.

// 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");

إظهار كيفية تعيين وصف النص للصورة.

// 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);

إظهار كيفية الحصول على صورة من وثيقة.

// 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>

إظهار كيفية الحصول على المعلومات الميتا للصورة.

// 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>

إظهار كيفية إضافة صورة جديدة مع علامة.

// 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);

يظهر كيفية إضافة صورة من ملف إلى وثيقة تحتوي على خصائص محددة للمستخدم.

// 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);

يظهر كيفية إضافة صورة من التدفق إلى وثيقة.

// 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);

يظهر كيفية إضافة صورة من ملف إلى وثيقة.

// 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(الستار)

يبدأ حالة جديدة من فئة WL31_.الصورة.

public Image(string path)

Parameters

path string

شريط يحتوي على المسار إلى الملف من أي لإنشاء Aspose.Note.صورة.

Image(string، string، string، string)

يبدأ حالة جديدة من فئة WL31_.الصورة.

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

Parameters

path string

شريط يحتوي على المسار إلى الملف من أي لإنشاء Aspose.Note.صورة.

altTitle string

العنوان البديل

altDescription string

وصف البديل .

Image(الشريط , Stream)

يبدأ حالة جديدة من فئة WL31_.الصورة.

public Image(string fileName, Stream imageStream)

Parameters

fileName string

اسم من الصورة.

imageStream Stream

الشبكة التي تحتوي على الصورة

Image()

يبدأ حالة جديدة من فئة WL31_.الصورة.

public Image()

Properties

Alignment

يحصل أو يضع التوافق.

public HorizontalAlignment Alignment { get; set; }

قيمة الممتلكات

HorizontalAlignment

Examples

يظهر كيفية إضافة صورة من ملف إلى وثيقة تحتوي على خصائص محددة للمستخدم.

// 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);

يظهر كيفية إضافة صورة من التدفق إلى وثيقة.

// 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);

يظهر كيفية إضافة صورة من ملف إلى وثيقة.

// 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

يحصل على أو وضع جسم نص بديل للصورة.

public string AlternativeTextDescription { get; set; }

قيمة الممتلكات

string

Examples

إظهار كيفية تعيين وصف النص للصورة.

// 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

يحصل أو يضع عنوان النص البديل للصورة.

public string AlternativeTextTitle { get; set; }

قيمة الممتلكات

string

Examples

إظهار كيفية تعيين وصف النص للصورة.

// 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

احصل على متجر بيانات الصورة.

public byte[] Bytes { get; }

قيمة الممتلكات

byte [ ]

Examples

إظهار كيفية الحصول على صورة من وثيقة.

// 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

احصل على اسم الملف.

public string FileName { get; }

قيمة الممتلكات

string

Examples

إظهار كيفية الحصول على المعلومات الميتا للصورة.

// 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

يحصل على الطريق إلى ملف الصورة.

public string FilePath { get; }

قيمة الممتلكات

string

Format

يحصل على شكل الصورة.

public ImageFormat Format { get; }

قيمة الممتلكات

ImageFormat

Height

هذا هو الارتفاع الحقيقي للصورة في مستند MS OneNote.

public float Height { get; set; }

قيمة الممتلكات

float

Examples

إظهار كيفية الحصول على المعلومات الميتا للصورة.

// 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>

يظهر كيفية إضافة صورة من ملف إلى وثيقة تحتوي على خصائص محددة للمستخدم.

// 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

يحصل أو يضع التعويضات الأفقية.

public float HorizontalOffset { get; set; }

قيمة الممتلكات

float

Examples

يظهر كيفية إضافة صورة من ملف إلى وثيقة تحتوي على خصائص محددة للمستخدم.

// 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

يحصل أو يضع الارتباط المرتبط بالصورة.

public string HyperlinkUrl { get; set; }

قيمة الممتلكات

string

Examples

يظهر كيفية ربط الرابط إلى صورة.

// 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

معرفة ما إذا كانت الصورة صورة خلفية.

public bool IsBackground { get; set; }

قيمة الممتلكات

bool

LastModifiedTime

يحصل أو يضع آخر وقت تم تعديله.

public DateTime LastModifiedTime { get; set; }

قيمة الممتلكات

DateTime

Examples

إظهار كيفية الحصول على المعلومات الميتا للصورة.

// 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

هذا هو العرض الأصلي للصورة، قبل إعادة التدوير.

public float OriginalHeight { get; }

قيمة الممتلكات

float

Examples

إظهار كيفية الحصول على المعلومات الميتا للصورة.

// 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

هذا هو العرض الأصلي للصورة، قبل إعادة التدوير.

public float OriginalWidth { get; }

قيمة الممتلكات

float

Examples

إظهار كيفية الحصول على المعلومات الميتا للصورة.

// 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

يحصل على قائمة جميع علامات الفقرة.

public List<itag> Tags { get; }

قيمة الممتلكات

List &lt؛ ITag >

Examples

إظهار كيفية إضافة صورة جديدة مع علامة.

// 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

يحصل أو يضع الخصم العمودي.

public float VerticalOffset { get; set; }

قيمة الممتلكات

float

Examples

يظهر كيفية إضافة صورة من ملف إلى وثيقة تحتوي على خصائص محددة للمستخدم.

// 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

هذا هو العرض الحقيقي للصورة في مستند MS OneNote.

public float Width { get; set; }

قيمة الممتلكات

float

Examples

إظهار كيفية الحصول على المعلومات الميتا للصورة.

// 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>

يظهر كيفية إضافة صورة من ملف إلى وثيقة تحتوي على خصائص محددة للمستخدم.

// 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)

يقبل زائر العقد.

public override void Accept(DocumentVisitor visitor)

Parameters

visitor DocumentVisitor

موضوع فئة مشتقة من Aspose.Note.DocumentVisitor.

Replace(Image)

يستبدل البيانات الحالية للصورة بالبيانات من الكائن الصورة المقدمة.

public void Replace(Image newImage)

Parameters

newImage Image

الكائن الصورة التي تحتوي على البيانات الجديدة.

 عربي