استخدم واجهة برمجة تطبيقات تحويل المستندات الخاصة بنا لإنشاء برنامج محمول وقوي وآمن في Java. هذا حل برمجي احترافي كامل لاستيراد وتصدير BMP, صورة والعديد من تنسيقات المستندات الأخرى باستخدام Java.
الحاجة إلى تحويل BMP الصورة ل صورة ملف برمجيا؟ باستخدام Aspose.Words for Java يمكن لأي مطور تحويل BMP بسهولة إلى صورة ببضعة سطور من كود Java.
تقوم المعالجة الحديثة للصور Java API بإنشاء صورة من BMP الصور بسرعة عالية. اختبر جودة BMP إلى صورة مباشرة في المستعرض. تسمح مكتبة Powerful Java BMP إلى العديد من تنسيقات المستندات الشائعة.
يوضح المثال التالي كيفية تحويل BMP إلى صورة في Java.
اتبع خطوات سهلة لتحويل BMP الصورة في صورة الشكل. اقرأ BMP من محرك الأقراص المحلي، ثم احفظها ببساطة باسم صورة، مع تحديد تنسيق المستند المطلوب بواسطة صورة extension. لكل BMP القراءة و صورة الكتابة يمكنك استخدام أسماء مؤهل بشكل كامل. سيكون محتوى الإخراج صورة BMP الأصلية.
// Repository path: https://releases.aspose.com/java/repo/
// Maven, where 'ver' - Aspose.Words version number, for example, 24.4.
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>ver</version>
<classifier>jdk17</classifier>
</dependency>
ينسخ
// Repository path: https://releases.aspose.com/java/repo/
// Gradle, where 'ver' - Aspose.Words version number, for example, 24.4.
compile(group: 'com.aspose', name: 'aspose-words', version: 'ver', classifier: 'jdk17')
ينسخ
// Repository path: https://releases.aspose.com/java/repo/
// Ivy, where 'ver' - Aspose.Words version number, for example, 24.4.
<dependency org="com.aspose" name="aspose-words" rev="ver">
<artifact name="aspose-words" m:classifier="jdk17" ext="jar"/>
</dependency>
ينسخ
// Repository path: https://releases.aspose.com/java/repo/
// Sbt, where 'ver' - Aspose.Words version number, for example, 24.4.
libraryDependencies += "com.aspose" % "aspose-words" % "ver"
ينسخ
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.insertImage("Input.bmp");
shape.getShapeRenderer().save("Output.jpg", new ImageSaveOptions(SaveFormat.JPG));
import com.aspose.words.*;
Document doc = new Document("Input.bmp");
doc.save("Output.jpg");
import com.aspose.words.*;
Document doc = new Document("Input.bmp");
ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFormat.jpg);
for (int page = 0; page < doc.getPageCount(); page++)
{
saveOptions.setPageSet(new PageSet(page));
doc.save(String.format("Output_%d.jpg", page + 1), saveOptions);
}
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertImage("Input.bmp");
doc.save("Output.jpg");
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.insertImage("Input.bmp");
shape.getShapeRenderer().save("Output.jpg", new ImageSaveOptions(SaveFormat.jpg));
نستضيف حزم Java بنا في مستودعات Maven. 'Aspose.Words for Java' هو JAR شائع يحتوي على كود بايت. يرجى اتباع التعليمات خطوة بخطوة حول كيفية تثبيته في بيئة مطور Java لديك.
Java SE 7 Java الأحدث. نوفر أيضًا حزمة منفصلة لـ Java SE 6 في حال كنت ملزمًا باستخدام JRE القديم هذا.
Java الخاصة بنا متعددة المنصات وتعمل على جميع أنظمة التشغيل مع JVM، بما في ذلك Microsoft Windows و Linux و macOS و Android و iOS.
للحصول على معلومات حول تبعيات الحزمة الاختيارية، مثل JogAmp JOGL، محرك خط Harfbuzz Java Advanced Imaging JAI، يرجى الرجوع إلى وثائق المنتج.