An open-source System.Drawing.Common replacement for .NET 5 and above on all platforms. Bringing together System.Drawing, Maui, and ImageSharp's Bitmap, Image, Font, and Shape types via an agnostic free NuGet package.
Other
120
stars
19
forks
source link
Feature: Added methods to load AnyBitmap from RGB buffer and retrieve RGB buffer from image #59
LoadAnyBitmapFromRGBBuffer: This method creates an AnyBitmap object from a provided buffer of RGB pixel data. It takes in a byte array, along with width and height parameters, and returns an AnyBitmap object.
byte[] buffer = YOUR_RGB_BUFFER;
using AnyBitmap result = AnyBitmap.LoadAnyBitmapFromRGBBuffer(buffer, width, height);
GetRGBBuffer: This method retrieves the RGB buffer from an AnyBitmap object. It returns an array of bytes representing the RGB buffer of the image.
using var bitmap = new AnyBitmap(YOUR_IMAGE_PATH);
byte[] buffer = bitmap.GetRGBBuffer();
These methods provide more flexibility when working with images and RGB data, simplifying the process of creating AnyBitmap objects from RGB buffers and retrieving RGB buffers from images.
Fixes #29
Type of change
Please select the relevant option by placing an 'x' inside the brackets, like this: [x].
[ ] π Bug fix (non-breaking change which fixes an issue)
[X] β¨ New feature (non-breaking change which adds functionality)
[ ] π₯ Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] ποΈ Internal/structural update (non-breaking change that improves code quality, organization, or performance)
[X] π This change requires a documentation update
[ ] π DevOps build chain modification for release
[ ] π€ DevOps build chain modification for CI
How Has This Been Tested?
Describe the tests you ran to verify your changes. Provide instructions so others can reproduce the tests. Also, list any relevant details for your test configuration.
Checklist:
Please run through the checklist as much as possible and mark the items completed by placing an 'x' inside the brackets, like this: [x].
[ ] My code follows the style guidelines of this project
[X] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[X] My changes generate no new warnings
[X] I have added tests that prove my fix is effective or that my feature works
[X] New and existing unit tests pass locally with my changes
[X] I have successfully run all unit tests on Windows
[X] I have successfully run all unit tests on Linux
Description
In this PR, two new methods were implemented:
LoadAnyBitmapFromRGBBuffer
: This method creates an AnyBitmap object from a provided buffer of RGB pixel data. It takes in a byte array, along with width and height parameters, and returns an AnyBitmap object.GetRGBBuffer
: This method retrieves the RGB buffer from an AnyBitmap object. It returns an array of bytes representing the RGB buffer of the image.These methods provide more flexibility when working with images and RGB data, simplifying the process of creating AnyBitmap objects from RGB buffers and retrieving RGB buffers from images.
Fixes #29
Type of change
Please select the relevant option by placing an 'x' inside the brackets, like this: [x].
How Has This Been Tested?
Describe the tests you ran to verify your changes. Provide instructions so others can reproduce the tests. Also, list any relevant details for your test configuration.
Checklist:
Please run through the checklist as much as possible and mark the items completed by placing an 'x' inside the brackets, like this: [x].