
تلعب علامات المياه دورًا حيويًا في التأكيد على امتلاك الصور ومنع الاستخدام غير المصرح به أو التزوير.يمكن تنفيذ ميزة علامة المياه الآلية في تطبيقات الويب أو سطح المكتب تحسين أمن الصورة بشكل كبير.في هذه المقالة ، سنقوم بإرشادك من خلال عملية إضافة علامات المياه إلى الصور ببرمجة باستخدام C#.
جدول المحتوى
- C# API لإضافة علامة المياه إلى الصور
- إضافة علامة المياه إلى صورة في C#
- إضافة علامة المياه الديغونية إلى الصور في C#
- الحصول على رخصة API مجانا
C# API لإضافة علامة المياه إلى الصور
To add watermarks to images, we will utilize the التفكير في .NET. This powerful image processing API supports various formats, including PNG, JPEG, and BMP, making image manipulation straightforward. You can either تحميل API Binary or install it via نوغيت using the following command:
PM> Install-Package Aspose.Imaging
إضافة علامة المياه إلى صورة في C#
اتبع هذه الخطوات لإضافة علامة المياه إلى صورة باستخدام C#:
- Load the image using the صورة class.
- Create an instance of the الرسومات class, initializing it with the صورة object.
- Define the font family, size, and style using the المصدر class.
- Create a سيلدبرش instance to set properties like color.
- Instantiate the StringFormat class to manage text alignment.
- Add the watermark to the image using the Graphics.DrawString(String، Font، SolidBrush، 0، StringFormat) method.
- Save the image using the Image.Save (حفظ الصورة) method.
فيما يلي عينة من الرمز التي تظهر كيفية إضافة علامة المياه إلى صورة في C#:

C# إضافة علامة المياه الديغونية إلى الصور
في بعض الأحيان ، يتم تطبيق علامات المياه بشكل متقاطع عبر الصور للحصول على تأثير أكثر تميزا.The Aspose.Imaging for .NET API allows you to rotate the watermark text to this.
- Load the image using the صورة class.
- Create a الرسومات instance initialized with the صورة object.
- Define the font family, size, and style with the المصدر class.
- Create a سيلدبرش instance to set properties like color.
- Instantiate a StringFormat object for text alignment.
- Create a ماتريكس instance to set the transformation angle.
- Assign the Matrix object to the التصوير الفوتوغرافي - Transform property.
- Add the watermark using the Graphics.DrawString(String، Font، SolidBrush، 0، StringFormat) method.
- Save the image using the Image.Save (حفظ الصورة) method.
وهنا نموذج من الرمز الذي يوضح كيفية إضافة علامة مياه الشريط إلى الصور باستخدام C#:

إدخال علامة المياه على الصور مع ترخيص مجاني
You can الحصول على ترخيص مؤقت مجاني to insert watermarks on images without any evaluation limitations.
استنتاجات
In this article, you learned how to add a watermark to images in C#. You also discovered how to rotate watermark text and how to add a watermark in PDF using C#. For further information about the C# image processing API, please refer to the الوثائق. If you have any questions or need assistance, feel free to reach out via our المنتدى.
انظر أيضا
More in this category
- C# Animation Maker Plugin: إنشاء الرسوم المتحركة الرائعة مع Aspose.Imaging
- Aspose.Imaging Image Effect Plugin: تحسين صورك مع الفلاتر المتقدمة
- دمج الصور في C# مع مكون Aspose.Imaging Image Merger بسعر 99 دولارًا
- معالجة الصور المؤسسية الميسورة التكلفة مع Aspose.Imaging
- تدوير الصور بأسعار معقولة في C# | ملحق Aspose.Imaging بقيمة 99 دولار