We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
提供一个可以转出图片的函数,但是转出来的图片会模糊,暂时不知道怎么解决
func (p *Page) Convert2Image() image.Image { // Render the PDF file width, height := p.Size() surface := cairo.NewSurface(cairo.FORMAT_ARGB32, int(width), int(height)) pattern := cairo.NewPatternForSurface(surface) pattern.SetFilter(cairo.CAIRO_FILTER_NEAREST) defer pattern.Destroy() _, drawcontext := surface.Native() surface.SetSource(pattern) C.poppler_page_render_for_printing(p.p, (*C.cairo_t)(unsafe.Pointer(drawcontext))) defer surface.Finish() return surface.GetImage() }
The text was updated successfully, but these errors were encountered:
提供一个可以转出图片的函数,但是转出来的图片会模糊,暂时不知道怎么解决 func (p *Page) Convert2Image() image.Image { // Render the PDF file width, height := p.Size() surface := cairo.NewSurface(cairo.FORMAT_ARGB32, int(width), int(height)) pattern := cairo.NewPatternForSurface(surface) pattern.SetFilter(cairo.CAIRO_FILTER_NEAREST) defer pattern.Destroy() _, drawcontext := surface.Native() surface.SetSource(pattern) C.poppler_page_render_for_printing(p.p, (*C.cairo_t)(unsafe.Pointer(drawcontext))) defer surface.Finish() return surface.GetImage() }
可以运行,报错 (process:382): GLib-GObject-CRITICAL **: 23:43:30.675: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
Sorry, something went wrong.
No branches or pull requests
提供一个可以转出图片的函数,但是转出来的图片会模糊,暂时不知道怎么解决
The text was updated successfully, but these errors were encountered: