mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-06 08:36:08 +08:00
FIX:fixed thumbnail not updating when using multiple plates
jira:[STUDIO-6313] Change-Id: If49daa5b38b9a580ae226ff00a1e0085d167c15c
This commit is contained in:
parent
13eeae7fa2
commit
7e81915780
@ -4548,7 +4548,7 @@ void EditDevNameDialog::on_edit_name(wxCommandEvent &e)
|
||||
dc.DrawBitmap(m_background_bitmap.bmp(), 0, 0);
|
||||
dc.DrawBitmap(m_bitmap, 0, 0);
|
||||
dc.SelectObject(wxNullBitmap);
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void ThumbnailPanel::OnPaint(wxPaintEvent& event) {
|
||||
|
@ -63,6 +63,7 @@ enum PrintFromType {
|
||||
};
|
||||
|
||||
static int get_brightness_value(wxImage image) {
|
||||
|
||||
wxImage grayImage = image.ConvertToGreyscale();
|
||||
|
||||
int width = grayImage.GetWidth();
|
||||
@ -71,9 +72,9 @@ static int get_brightness_value(wxImage image) {
|
||||
int totalLuminance = 0;
|
||||
unsigned char alpha;
|
||||
int num_none_transparent = 0;
|
||||
for (int y = 0; y < height; y+=2) {
|
||||
for (int y = 0; y < height; y += 2) {
|
||||
|
||||
for (int x = 0; x < width; x+=2) {
|
||||
for (int x = 0; x < width; x += 2) {
|
||||
|
||||
alpha = image.GetAlpha(x, y);
|
||||
if (alpha != 0) {
|
||||
@ -83,6 +84,9 @@ static int get_brightness_value(wxImage image) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (totalLuminance <= 0 || num_none_transparent <= 0) {
|
||||
return 0;
|
||||
}
|
||||
return totalLuminance / num_none_transparent;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user