【问题标题】:System.Drawing.Image to SkiaSharpSystem.Drawing.Image 到 SkiaSharp
【发布时间】:2022-11-18 08:25:03
【问题描述】:

我正在尝试将我的代码从使用 System.Drawing.Image 移动到使用 SkiaSharp 推荐 here

我试图找到类似的操作来处理流中的 Tif 文件。

目前,以下是我使用的System.Drawing.Image

System.Drawing.Image MyImage = System.Drawing.Image.FromStream(inStream);
PdfDocument doc = new PdfDocument();

for (int PageIndex = 0; PageIndex < MyImage.GetFrameCount(FrameDimension.Page); PageIndex++)
{
    MyImage.SelectActiveFrame(FrameDimension.Page, PageIndex);
    XImage img = XImage.FromGdiPlusImage(MyImage);
    var page = new PdfPage();

    page.Width = MyImage.Width;
    page.Height = MyImage.Height;
    doc.Pages.Add(page);
    XGraphics xgr = XGraphics.FromPdfPage(doc.Pages[PageIndex]);
    xgr.DrawImage(img, 0, 0, page.Width, page.Height);
}

doc.Save(outStream);
MyImage.Dispose();

【问题讨论】:

  • 发布您到目前为止尝试过的 Skiasharp 代码。您是否查看过 Skia 的文档?什么具体的你有困难吗? ...或者您只是希望我们为您做这一切?

标签: c# .net-core system.drawing skiasharp system.drawing.common


【解决方案1】:

#include<stdio.h>

诠释主要(无效)

Int J

Printf("entrez un nombre");
Scanf(:%d",&J);

返回 0;

【讨论】:

    猜你喜欢
    • 2023-04-02
    • 2015-09-28
    • 2016-06-02
    • 1970-01-01
    • 1970-01-01
    • 2022-01-02
    • 1970-01-01
    • 2020-08-05
    • 1970-01-01
    相关资源
    最近更新 更多