Add date/time to top of merged image - format: yyyy年M月d日 HH:mm:ss
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
#Fri Mar 06 22:54:40 CST 2026
|
#Fri Mar 06 23:02:01 CST 2026
|
||||||
path.4=14/classes.dex
|
path.4=14/classes.dex
|
||||||
path.3=12/classes.dex
|
path.3=12/classes.dex
|
||||||
path.2=10/classes.dex
|
path.2=10/classes.dex
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
|||||||
39
|
40
|
||||||
0
|
0
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
|||||||
ëXè¾ú¹Ñ~Ì>Ňôï`ý¿ÄJùÉïNÔ›î×úbå4å²×?Í#à“À2èjÓ*ú3
|
ëXè¾ú¹Ñ~Ì>Ňôï`ý¿ÄJùÉïNÔ›î×úbå4å²×?Í#à“À2èjÓ*ú3ð²À
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -234,12 +234,13 @@ object ImageProcessor {
|
|||||||
0f
|
0f
|
||||||
}
|
}
|
||||||
|
|
||||||
// 顶部标题区域高度
|
// 顶部标题区域高度(标题 + 日期时间,两行)
|
||||||
val topTitleHeight = if (title.isNotBlank()) {
|
val topTitleHeight = if (title.isNotBlank()) {
|
||||||
val titlePaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
val titlePaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||||
textSize = outputWidth / 20f
|
textSize = outputWidth / 20f
|
||||||
}
|
}
|
||||||
titlePaint.fontMetrics.let { it.descent - it.ascent } + 40f
|
val lineHeight = titlePaint.fontMetrics.let { it.descent - it.ascent }
|
||||||
|
lineHeight * 2 + 50f // 两行文字高度 + 间距
|
||||||
} else 0f
|
} else 0f
|
||||||
|
|
||||||
// 图片区域高度
|
// 图片区域高度
|
||||||
@@ -262,16 +263,32 @@ object ImageProcessor {
|
|||||||
Paint().apply { color = android.graphics.Color.WHITE }
|
Paint().apply { color = android.graphics.Color.WHITE }
|
||||||
)
|
)
|
||||||
|
|
||||||
// 深色标题文字
|
// 标题文字
|
||||||
val titlePaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
val titlePaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||||
textSize = outputWidth / 20f
|
textSize = outputWidth / 20f
|
||||||
color = android.graphics.Color.argb(255, 51, 51, 51) // 深灰色文字
|
color = android.graphics.Color.argb(255, 51, 51, 51)
|
||||||
typeface = Typeface.create("sans-serif", Typeface.BOLD)
|
typeface = Typeface.create("sans-serif", Typeface.BOLD)
|
||||||
textAlign = android.graphics.Paint.Align.CENTER
|
textAlign = android.graphics.Paint.Align.CENTER
|
||||||
isAntiAlias = true
|
isAntiAlias = true
|
||||||
}
|
}
|
||||||
val titleY = topTitleHeight / 2 + titlePaint.fontMetrics.let { it.descent - it.ascent } / 2
|
val lineHeight = titlePaint.fontMetrics.let { it.descent - it.ascent }
|
||||||
|
|
||||||
|
// 第一行:标题
|
||||||
|
val titleY = topTitleHeight * 0.3f + titlePaint.fontMetrics.let { it.descent - it.ascent } / 2
|
||||||
canvas.drawText(title, outputWidth / 2f, titleY, titlePaint)
|
canvas.drawText(title, outputWidth / 2f, titleY, titlePaint)
|
||||||
|
|
||||||
|
// 第二行:日期时间
|
||||||
|
val dateFormat = java.text.SimpleDateFormat("yyyy年M月d日 HH:mm:ss", java.util.Locale.getDefault())
|
||||||
|
val dateTimeText = dateFormat.format(java.util.Date())
|
||||||
|
val datePaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||||
|
textSize = outputWidth / 28f
|
||||||
|
color = android.graphics.Color.argb(255, 80, 80, 80)
|
||||||
|
typeface = Typeface.create("sans-serif", Typeface.NORMAL)
|
||||||
|
textAlign = android.graphics.Paint.Align.CENTER
|
||||||
|
isAntiAlias = true
|
||||||
|
}
|
||||||
|
val dateY = topTitleHeight * 0.75f + datePaint.fontMetrics.let { it.descent - it.ascent } / 2
|
||||||
|
canvas.drawText(dateTimeText, outputWidth / 2f, dateY, datePaint)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 绘制图片网格
|
// 绘制图片网格
|
||||||
|
|||||||
Reference in New Issue
Block a user