-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are there any examples that uses SkiaSharp to save and manipulate the PDF image? #81
Labels
enhancement
New feature or request
Comments
public static SKBitmap ToSkiaImage(this byte[] fileBytes, int page = 0)
{
var (imageContent, width, height) = fileBytes.ToImage(page);
var memoryStream = new MemoryStream(imageContent);
var skData = SKData.Create(memoryStream);
var bitmap = SKBitmap.Decode(skData, new SKImageInfo(width, height, SKColorType.Bgra8888));
return bitmap;
} I tried with this method as well, and the bitmap return null |
Not far from my working solution public static SKBitmap ToSkiaImage(byte[] bytes, int width, int height)
{
var bmp = new SKBitmap(new SKImageInfo(width, height,SKColorType.Bgra8888));
Marshal.Copy(bytes, 0, bmp.GetPixels(), bytes.Length);
return bmp;
} |
Triaged and approved, will add an example |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried to search an example that uses SkiaSharp to manipulate images instead of System.Drawings because i am using linux.
This is as far as i got.
The text was updated successfully, but these errors were encountered: