|
|
@ -41,17 +41,9 @@ public abstract class TemplateThemePreviewPane<T extends TemplateTheme> extends |
|
|
|
|
|
|
|
|
|
|
|
int thumbnailWidth = ThemeThumbnail.WIDTH; |
|
|
|
int thumbnailWidth = ThemeThumbnail.WIDTH; |
|
|
|
int thumbnailHeight = ThemeThumbnail.HEIGHT; |
|
|
|
int thumbnailHeight = ThemeThumbnail.HEIGHT; |
|
|
|
float thumbnailAspect = 1.0F * thumbnailWidth / thumbnailHeight; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int width = getWidth(); |
|
|
|
int width = getWidth(); |
|
|
|
int height = getHeight(); |
|
|
|
int height = getHeight(); |
|
|
|
float aspect = 1.0F * width / height; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (thumbnailAspect > aspect) { |
|
|
|
|
|
|
|
height = (int) (width / thumbnailAspect); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
width = (int) (height * thumbnailAspect); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
// 使用TYPE_INT_RGB和new Color(255, 255, 255, 1)设置有透明背景buffer image,
|
|
|
|
// 使用TYPE_INT_RGB和new Color(255, 255, 255, 1)设置有透明背景buffer image,
|
|
|
|