本文整理匯總了Golang中github.com/llgcode/draw2d.GraphicContext.GetDPI方法的典型用法代碼示例。如果您正苦於以下問題:Golang GraphicContext.GetDPI方法的具體用法?Golang GraphicContext.GetDPI怎麽用?Golang GraphicContext.GetDPI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/llgcode/draw2d.GraphicContext
的用法示例。
在下文中一共展示了GraphicContext.GetDPI方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Main
// Main draws "Hello World" and returns the filename. This should only be
// used during testing.
func Main(gc draw2d.GraphicContext, ext string) (string, error) {
// Draw hello world
Draw(gc, fmt.Sprintf("Hello World %d dpi", gc.GetDPI()))
// Return the output filename
return samples.Output("helloworld", ext), nil
}
示例2: UseImageWithContext
// UseImageWithContext specifies both an image
// and a graphic context to create the canvas from.
// The minimum point of the given image
// should probably be 0,0.
func UseImageWithContext(img draw.Image, gc draw2d.GraphicContext) option {
return func(c *Canvas) uint32 {
c.img = img
c.gc = gc
c.dpi = gc.GetDPI()
return setsDPI | setsSize
}
}