OneNote in Bild konvertieren
Sparen Sie OneNote auf das Bild im BMP -Format mit den Standardoptionen
Das folgende Codebeispiel zeigt, wie OneNote in das BMP -Format mithilfe der Standardoptionen in das Bild konvertiert wird. Standardmäßig wird nur die erste Seite gespeichert. Das gespeicherte Bild hat eine Auflösung von 96 dpi.
1 // The path to the documents directory.
2 string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
3
4 // Load the document into Aspose.Note.
5 Document oneFile = new Document(dataDir + "Aspose.one");
6
7 dataDir = dataDir + "SaveToBmpImageUsingImageSaveOptions_out.bmp";
8
9 // Save the document as gif.
10 oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Bmp));
Sparen Sie OneNote auf das Bild im GIF -Format mit den Standardoptionen **
Das folgende Codebeispiel zeigt, wie OneNote in das GIF -Format mithilfe der Standardoptionen in das Bild konvertiert wird. Standardmäßig wird nur die erste Seite gespeichert. Das gespeicherte Bild hat eine Auflösung von 96 dpi.
1// The path to the documents directory.
2string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
3
4// Load the document into Aspose.Note.
5Document oneFile = new Document(dataDir + "Aspose.one");
6
7dataDir = dataDir + "SaveToImageDefaultOptions_out.gif";
8
9// Save the document as gif.
10oneFile.Save(dataDir, SaveFormat.Gif);
Speichern Sie eine bestimmte Seite von OneNote auf Bild
Das folgende Codebeispiel zeigt, wie eine bestimmte Seite von OneNote in das Bild im PNG -Format konvertiert wird. Die Seite wird angegeben, indem die PageIndex -Eigenschaft von ImagesaveOptions Instanz festgelegt wird. Das gespeicherte Bild hat eine Auflösung von 96 dpi.
1// The path to the documents directory.
2string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
3
4// Load the document into Aspose.Note.
5Document oneFile = new Document(dataDir + "Aspose.one");
6
7// Initialize ImageSaveOptions object
8ImageSaveOptions opts = new ImageSaveOptions(SaveFormat.Png);
9
10// Set page index
11opts.PageIndex = 1;
12
13dataDir = dataDir + "ConvertSpecificPageToImage_out.png";
14
15// Save the document as PNG.
16oneFile.Save(dataDir, opts);
Geben Sie die Auflösung für das Ausgabebild an
Das folgende Codebeispiel zeigt, wie die Auflösung des Ausgabebildes angegeben wird. Die Auflösung wird angegeben, indem die Auflösungseigenschaft von ImagesaveOptions Instanz festgelegt wird.
1// The path to the documents directory.
2string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
3
4// Load the document into Aspose.Note.
5Document doc = new Document(dataDir + "Aspose.one");
6
7dataDir = dataDir + "SetOutputImageResolution_out.jpg";
8
9// Save the document.
10doc.Save(dataDir, new ImageSaveOptions(SaveFormat.Jpeg) { Resolution = 220 });
Geben Sie die Qualität für Ausgabebild an
Das folgende Codebeispiel zeigt, wie OneNote in das JPEG -Format mit angegebener Komprimierungsqualität in das Bild konvertiert wird. Die Komprimierungsqualität wird angegeben, indem die Qualitätseigenschaft von ImagesaveOptions Instanz festgelegt wird. Diese Einstellung wird verwendet, wenn Bild im verlustigen Format gespeichert wird. Die Bildqualität kann von 0 auf 100 eingestellt werden. Null zeigt die niedrigste Qualität an, und 100 ergibt die höchste Qualität für das Bild. Der Standard -Qualitätswert beträgt 90.
1// The path to the documents directory.
2string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
3
4// Load the document into Aspose.Note.
5Document doc = new Document(dataDir + "Aspose.one");
6
7dataDir = dataDir + "SetOutputImageResolution_out.jpg";
8
9// Save the document.
10doc.Save(dataDir, new ImageSaveOptions(SaveFormat.Jpeg) { Quality = 100 });