x_merge

package
v0.0.0-...-0df5ea9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func SimpleMerge

func SimpleMerge(name string, imgs []image.Image, r image.Rectangle, p image.Point) error

SimpleMerge

param: name Full path of merged image name 合并后图像名称 全路径

param: imgs image.Image Slice Or Array image.Image 切片或数组

param: r image.Rectangle Uniform zoom Rectangle

param: p mage.Point Uniform zoom Point

Example
package main

import (
	"fmt"
	"github.com/guolei19850528/go_x_pkgs/x_image/x_coder"
	"github.com/guolei19850528/go_x_pkgs/x_image/x_merge"
	"image"
	"path"
)

func main() {
	imgPath1 := "image path"
	imgPath2 := "image path"
	imgPath3 := "image path"
	imgPath4 := "image path"

	img1, _ := x_coder.GetImgByName(imgPath1)
	img2, _ := x_coder.GetImgByName(imgPath2)
	img3, _ := x_coder.GetImgByName(imgPath3)
	img4, _ := x_coder.GetImgByName(imgPath4)

	imgs := make([]image.Image, 0, 0)
	imgs = append(imgs, img1)
	imgs = append(imgs, img2)
	imgs = append(imgs, img3)
	imgs = append(imgs, img4)
	//x_slice.ReverseNoSort(imgs)
	err := x_merge.SimpleMerge(path.Join("your output path", "1.png"), imgs, image.Rect(0, 0, 2200, 2200), image.Pt(0, 0))
	if err == nil {
		fmt.Println("successful")
	}
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL