GifFrameBlock

GifFrameBlock(ushort, ushort)

يقوم بتهيئة مثيل جديد لملفGifFrameBlock فئة .

public GifFrameBlock(ushort width, ushort height)
معامليكتبوصف
widthUInt16عرض الصورة.
heightUInt16ارتفاع الصورة.

أمثلة

يوضح هذا المثال كيفية إنشاء صورة GIF وحفظها في ملف.

[C#]

string dir = "c:\\temp\\";

// قم بإنشاء كتلة إطار GIF بحجم 100 × 100 بكسل.
using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
{
    // املأ الكتلة بالكامل باللون الأحمر.
    Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(firstBlock);
    Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);
    gr.FillRectangle(brush, firstBlock.Bounds);

    using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock))
    {
        gifImage.Save(dir + "output.gif");
    }
}

يوضح هذا المثال كيفية إنشاء صورة GIF باستخدام لوحة مخصصة وحفظها في ملف.

[C#]

string dir = "c:\\temp\\";

// قم بإنشاء كتلة إطار GIF بحجم 100 × 100 بكسل.
using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
{
    // املأ الكتلة بالكامل باللون الأحمر.
    Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(firstBlock);
    Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);
    gr.FillRectangle(brush, firstBlock.Bounds);

    // استخدم لوحة 4 بت لتقليل حجم الصورة. يمكن أن تسوء الجودة.
    Aspose.Imaging.IColorPalette palette = Aspose.Imaging.ColorPaletteHelper.Create4Bit();

    using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock, palette))
    {
        gifImage.Save(dir + "output.gif");
    }
}

يوضح المثال التالي كيفية إنشاء صورة GIF متحركة من كتل GIF فردية.

[C#]

string dir = "c:\\temp\\";

// أنشئ صورة بتنسيق GIF 100 × 100 بكسل.
// الكتلة الأولى سوداء بالكامل بشكل افتراضي.
using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock))
{
    // الدائرة الأولى حمراء
    Aspose.Imaging.Brushes.SolidBrush brush1 = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);

    // الدائرة الثانية سوداء
    Aspose.Imaging.Brushes.SolidBrush brush2 = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Black);

    // زد زاوية شكل القوس الأحمر تدريجيًا.
    for (int angle = 10; angle <= 360; angle += 10)
    {
        Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock block = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100);

        Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(block);
        gr.FillPie(brush1, block.Bounds, 0, angle);

        gifImage.AddBlock(block);
    }

    // زد زاوية القوس الأسود تدريجيًا وامسح القوس الأحمر.
    for (int angle = 10; angle <= 360; angle += 10)
    {
        Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock block = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100);

        Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(block);
        gr.FillPie(brush2, block.Bounds, 0, angle);
        gr.FillPie(brush1, block.Bounds, angle, 360 - angle);

        gifImage.AddBlock(block);
    }

    gifImage.Save(dir + "animated_radar.gif");
}

أنظر أيضا


GifFrameBlock(ushort, ushort, ushort, ushort)

يقوم بتهيئة مثيل جديد لملفGifFrameBlock فئة .

public GifFrameBlock(ushort left, ushort top, ushort width, ushort height)
معامليكتبوصف
leftUInt16موضع الصورة الأيسر.
topUInt16موضع الصورة العلوي.
widthUInt16عرض الصورة.
heightUInt16ارتفاع الصورة.

أنظر أيضا


GifFrameBlock(ushort, ushort, ushort, ushort, IColorPalette, bool, bool, byte)

يقوم بتهيئة مثيل جديد لملفGifFrameBlock فئة .

public GifFrameBlock(ushort left, ushort top, ushort width, ushort height, 
    IColorPalette colorPalette, bool isPaletteSorted, bool isGifFrameInterlaced, byte bitsPerPixel)
معامليكتبوصف
leftUInt16موضع الصورة الأيسر.
topUInt16موضع الصورة العلوي.
widthUInt16عرض الصورة.
heightUInt16ارتفاع الصورة.
colorPaletteIColorPaletteلوحة الألوان.
isPaletteSortedBooleanإذا تم التعيين علىحقيقي يتم فرز لوحة الألوان.
isGifFrameInterlacedBooleanإذا تم التعيين علىحقيقي إطار GIF متشابك.
bitsPerPixelByteوحدات البت لكل بكسل.

أنظر أيضا


GifFrameBlock(RasterImage)

يقوم بتهيئة مثيل جديد لملفGifFrameBlock فئة .

public GifFrameBlock(RasterImage image)
معامليكتبوصف
imageRasterImageالصورة المراد تهيئة بكسل الإطار وبيانات اللوحة بها.

أنظر أيضا


GifFrameBlock(RasterImage, ushort, ushort)

يقوم بتهيئة مثيل جديد لملفGifFrameBlock فئة .

public GifFrameBlock(RasterImage image, ushort left, ushort top)
معامليكتبوصف
imageRasterImageالصورة المراد تهيئة بكسل الإطار وبيانات اللوحة بها.
leftUInt16موضع الصورة الأيسر.
topUInt16موضع الصورة العلوي.

أنظر أيضا


GifFrameBlock(RasterImage, ushort, ushort, bool, bool, byte)

يقوم بتهيئة مثيل جديد لملفGifFrameBlock فئة .

public GifFrameBlock(RasterImage image, ushort left, ushort top, bool isPaletteSorted, 
    bool isGifFrameInterlaced, byte lzwCodeSize)
معامليكتبوصف
imageRasterImageالصورة المراد تهيئة بكسل الإطار وبيانات اللوحة بها.
leftUInt16موضع الصورة الأيسر.
topUInt16موضع الصورة العلوي.
isPaletteSortedBooleanإذا تم التعيين علىحقيقي يتم فرز لوحة الألوان.
isGifFrameInterlacedBooleanإذا تم التعيين علىحقيقي إطار GIF متشابك.
lzwCodeSizeByteوحدات البت لكل بكسل.

أنظر أيضا


GifFrameBlock(Stream)

يقوم بتهيئة مثيل جديد لملفGifFrameBlock فئة .

public GifFrameBlock(Stream stream)
معامليكتبوصف
streamStreamالدفق لتحميل صورة من وتهيئة بكسل الإطار وبيانات اللوحة باستخدام.

أنظر أيضا


GifFrameBlock(Stream, ushort, ushort)

يقوم بتهيئة مثيل جديد لملفGifFrameBlock فئة .

public GifFrameBlock(Stream stream, ushort left, ushort top)
معامليكتبوصف
streamStreamالدفق لتحميل صورة من وتهيئة بكسل الإطار وبيانات اللوحة باستخدام.
leftUInt16موضع الصورة الأيسر.
topUInt16موضع الصورة العلوي.

أنظر أيضا


GifFrameBlock(Stream, ushort, ushort, bool, bool, byte)

يقوم بتهيئة مثيل جديد لملفGifFrameBlock فئة .

public GifFrameBlock(Stream stream, ushort left, ushort top, bool isPaletteSorted, 
    bool isGifFrameInterlaced, byte lzwCodeSize)
معامليكتبوصف
streamStreamالدفق لتحميل صورة من وتهيئة بكسل الإطار وبيانات اللوحة باستخدام.
leftUInt16موضع الصورة الأيسر.
topUInt16موضع الصورة العلوي.
isPaletteSortedBooleanإذا تم التعيين علىحقيقي يتم فرز لوحة الألوان.
isGifFrameInterlacedBooleanإذا تم التعيين علىحقيقي إطار GIF متشابك.
lzwCodeSizeByteوحدات البت لكل بكسل.

أنظر أيضا


GifFrameBlock(string)

يقوم بتهيئة مثيل جديد لملفGifFrameBlock فئة .

public GifFrameBlock(string path)
معامليكتبوصف
pathStringالمسار المطلوب تحميل صورة منه وتهيئة بكسل الإطار وبيانات اللوحة به.

أنظر أيضا


GifFrameBlock(string, ushort, ushort)

يقوم بتهيئة مثيل جديد لملفGifFrameBlock فئة .

public GifFrameBlock(string path, ushort left, ushort top)
معامليكتبوصف
pathStringالمسار المطلوب تحميل صورة منه وتهيئة بكسل الإطار وبيانات اللوحة به.
leftUInt16موضع الصورة الأيسر.
topUInt16موضع الصورة العلوي.

أنظر أيضا


GifFrameBlock(string, ushort, ushort, bool, bool, byte)

يقوم بتهيئة مثيل جديد لملفGifFrameBlock فئة .

public GifFrameBlock(string path, ushort left, ushort top, bool isPaletteSorted, 
    bool isGifFrameInterlaced, byte lzwCodeSize)
معامليكتبوصف
pathStringالمسار المطلوب تحميل صورة منه وتهيئة بكسل الإطار وبيانات اللوحة به.
leftUInt16موضع الصورة الأيسر.
topUInt16موضع الصورة العلوي.
isPaletteSortedBooleanإذا تم التعيين علىحقيقي يتم فرز لوحة الألوان.
isGifFrameInterlacedBooleanإذا تم التعيين علىحقيقي إطار GIF متشابك.
lzwCodeSizeByteوحدات البت لكل بكسل.

أنظر أيضا