mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-11 16:00:17 -07:00
update dc.DrawBitmap calls to use get_bitmap
This commit is contained in:
parent
e114881ed5
commit
cdff9ba9fa
22 changed files with 75 additions and 75 deletions
|
|
@ -31,7 +31,7 @@ void AboutDialogLogo::onRepaint(wxEvent &event)
|
|||
wxSize size = this->GetSize();
|
||||
int logo_w = this->logo.GetBmpWidth();
|
||||
int logo_h = this->logo.GetBmpHeight();
|
||||
dc.DrawBitmap(this->logo.bmp(), (size.GetWidth() - logo_w)/2, (size.GetHeight() - logo_h)/2, true);
|
||||
dc.DrawBitmap(this->logo.get_bitmap(), (size.GetWidth() - logo_w)/2, (size.GetHeight() - logo_h)/2, true);
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ void MaterialItem::doRender(wxDC &dc)
|
|||
auto acolor = m_ams_coloul;
|
||||
|
||||
if (mcolor.Alpha() == 0) {
|
||||
dc.DrawBitmap(m_transparent_mitem.bmp(), FromDIP(1), FromDIP(1));
|
||||
dc.DrawBitmap(m_transparent_mitem.get_bitmap(), FromDIP(1), FromDIP(1));
|
||||
}
|
||||
|
||||
if (!IsEnabled()) {
|
||||
|
|
@ -247,10 +247,10 @@ void MaterialItem::doRender(wxDC &dc)
|
|||
//arrow
|
||||
if ( (acolor.Red() > 160 && acolor.Green() > 160 && acolor.Blue() > 160) &&
|
||||
(acolor.Red() < 180 && acolor.Green() < 180 && acolor.Blue() < 180)) {
|
||||
dc.DrawBitmap(m_arraw_bitmap_white.bmp(), GetSize().x - m_arraw_bitmap_white.GetBmpSize().x - FromDIP(7), GetSize().y - m_arraw_bitmap_white.GetBmpSize().y);
|
||||
dc.DrawBitmap(m_arraw_bitmap_white.get_bitmap(), GetSize().x - m_arraw_bitmap_white.GetBmpSize().x - FromDIP(7), GetSize().y - m_arraw_bitmap_white.GetBmpSize().y);
|
||||
}
|
||||
else {
|
||||
dc.DrawBitmap(m_arraw_bitmap_gray.bmp(), GetSize().x - m_arraw_bitmap_gray.GetBmpSize().x - FromDIP(7), GetSize().y - m_arraw_bitmap_gray.GetBmpSize().y);
|
||||
dc.DrawBitmap(m_arraw_bitmap_gray.get_bitmap(), GetSize().x - m_arraw_bitmap_gray.GetBmpSize().x - FromDIP(7), GetSize().y - m_arraw_bitmap_gray.GetBmpSize().y);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -677,7 +677,7 @@ void MappingItem::doRender(wxDC &dc)
|
|||
dc.SetBrush(wxBrush(m_coloul));
|
||||
|
||||
if (m_coloul.Alpha() == 0) {
|
||||
dc.DrawBitmap( m_transparent_mapping_item.bmp(), 0, (GetSize().y - MAPPING_ITEM_REAL_SIZE.y) / 2);
|
||||
dc.DrawBitmap( m_transparent_mapping_item.get_bitmap(), 0, (GetSize().y - MAPPING_ITEM_REAL_SIZE.y) / 2);
|
||||
}
|
||||
else {
|
||||
dc.DrawRectangle(0, (GetSize().y - MAPPING_ITEM_REAL_SIZE.y) / 2, MAPPING_ITEM_REAL_SIZE.x, MAPPING_ITEM_REAL_SIZE.y);
|
||||
|
|
@ -1493,7 +1493,7 @@ void AmsRMGroup::doRender(wxDC& dc)
|
|||
float startAngle = 0.0;
|
||||
float endAngle = 0.0;
|
||||
|
||||
dc.DrawBitmap(bitmap_bg.bmp(), wxPoint((size.x - bitmap_bg.GetBmpSize().x) / 2, (size.y - bitmap_bg.GetBmpSize().y) / 2));
|
||||
dc.DrawBitmap(bitmap_bg.get_bitmap(), wxPoint((size.x - bitmap_bg.GetBmpSize().x) / 2, (size.y - bitmap_bg.GetBmpSize().y) / 2));
|
||||
|
||||
for (auto iter = m_group_info.rbegin(); iter != m_group_info.rend(); ++iter) {
|
||||
std::string tray_name = iter->first;
|
||||
|
|
@ -1571,7 +1571,7 @@ void AmsRMGroup::doRender(wxDC& dc)
|
|||
dc.DrawEllipticArc(x - center_mask_radius, y - center_mask_radius, center_mask_radius * 2, center_mask_radius * 2, 0, 360);
|
||||
|
||||
//draw center icon
|
||||
dc.DrawBitmap(bitmap_backup_tips_0.bmp(), wxPoint((size.x - bitmap_backup_tips_0.GetBmpSize().x) / 2, (size.y - bitmap_backup_tips_0.GetBmpSize().y) / 2));
|
||||
dc.DrawBitmap(bitmap_backup_tips_0.get_bitmap(), wxPoint((size.x - bitmap_backup_tips_0.GetBmpSize().x) / 2, (size.y - bitmap_backup_tips_0.GetBmpSize().y) / 2));
|
||||
//dc.DrawBitmap(bitmap_backup_tips_1.bmp(), wxPoint((size.x - bitmap_backup_tips_1.GetBmpSize().x) / 2, (size.y - bitmap_backup_tips_1.GetBmpSize().y) / 2));
|
||||
|
||||
//draw material
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ void AuFile::PaintBackground(wxDC &dc)
|
|||
dc.SetPen(AUFILE_GREY200);
|
||||
dc.SetBrush(AUFILE_GREY200);
|
||||
dc.DrawRoundedRectangle(0, 0, size.x, size.y, AUFILE_ROUNDING);
|
||||
dc.DrawBitmap(m_file_bitmap.bmp(), (size.x - m_file_bitmap.GetBmpWidth()) / 2, (size.y - m_file_bitmap.GetBmpHeight()) / 2);
|
||||
dc.DrawBitmap(m_file_bitmap.get_bitmap(), (size.x - m_file_bitmap.GetBmpWidth()) / 2, (size.y - m_file_bitmap.GetBmpHeight()) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -257,7 +257,7 @@ void AuFile::PaintForeground(wxDC &dc)
|
|||
}
|
||||
|
||||
if (m_type == MODEL_PICTURE) {
|
||||
dc.DrawBitmap(m_file_edit_mask.bmp(), 0, size.y - m_file_edit_mask.GetBmpSize().y);
|
||||
dc.DrawBitmap(m_file_edit_mask.get_bitmap(), 0, size.y - m_file_edit_mask.GetBmpSize().y);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -297,7 +297,7 @@ void AuFile::PaintForeground(wxDC &dc)
|
|||
|
||||
if (m_cover) {
|
||||
dc.SetTextForeground(*wxWHITE);
|
||||
dc.DrawBitmap(m_file_cover.bmp(), size.x - m_file_cover.GetBmpSize().x, 0);
|
||||
dc.DrawBitmap(m_file_cover.get_bitmap(), size.x - m_file_cover.GetBmpSize().x, 0);
|
||||
dc.SetFont(Label::Body_12);
|
||||
auto sizet = dc.GetTextExtent(cover_text_cover);
|
||||
auto pos = wxPoint(0, 0);
|
||||
|
|
@ -306,7 +306,7 @@ void AuFile::PaintForeground(wxDC &dc)
|
|||
dc.DrawText(cover_text_cover, pos);
|
||||
}
|
||||
|
||||
if (m_hover) { dc.DrawBitmap(m_file_delete.bmp(), size.x - m_file_delete.GetBmpSize().x - FromDIP(10), FromDIP(10)); }
|
||||
if (m_hover) { dc.DrawBitmap(m_file_delete.get_bitmap(), size.x - m_file_delete.GetBmpSize().x - FromDIP(10), FromDIP(10)); }
|
||||
}
|
||||
|
||||
void AuFile::on_mouse_enter(wxMouseEvent &evt)
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ void MObjectPanel::doRender(wxDC& dc)
|
|||
if (m_state == PrinterState::IN_LAN) { dwbitmap = m_printer_in_lan; }
|
||||
|
||||
// dc.DrawCircle(left, size.y / 2, 3);
|
||||
dc.DrawBitmap(dwbitmap.bmp(), wxPoint(left, (size.y - dwbitmap.GetBmpSize().y) / 2));
|
||||
dc.DrawBitmap(dwbitmap.get_bitmap(), wxPoint(left, (size.y - dwbitmap.GetBmpSize().y) / 2));
|
||||
|
||||
left += dwbitmap.GetBmpSize().x + 8;
|
||||
dc.SetFont(Label::Body_13);
|
||||
|
|
|
|||
|
|
@ -519,9 +519,9 @@ void CameraItem::render(wxDC &dc)
|
|||
void CameraItem::doRender(wxDC &dc)
|
||||
{
|
||||
if (m_hover) {
|
||||
dc.DrawBitmap(m_bitmap_hover.bmp(), wxPoint((GetSize().x - m_bitmap_hover.GetBmpSize().x) / 2, (GetSize().y - m_bitmap_hover.GetBmpSize().y) / 2));
|
||||
dc.DrawBitmap(m_bitmap_hover.get_bitmap(), wxPoint((GetSize().x - m_bitmap_hover.GetBmpSize().x) / 2, (GetSize().y - m_bitmap_hover.GetBmpSize().y) / 2));
|
||||
} else {
|
||||
dc.DrawBitmap(m_bitmap_normal.bmp(), wxPoint((GetSize().x - m_bitmap_normal.GetBmpSize().x) / 2, (GetSize().y - m_bitmap_normal.GetBmpSize().y) / 2));
|
||||
dc.DrawBitmap(m_bitmap_normal.get_bitmap(), wxPoint((GetSize().x - m_bitmap_normal.GetBmpSize().x) / 2, (GetSize().y - m_bitmap_normal.GetBmpSize().y) / 2));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1625,8 +1625,8 @@ void ConfigWizardIndex::on_paint(wxPaintEvent & evt)
|
|||
|
||||
wxPaintDC dc(this);
|
||||
|
||||
const auto bullet_w = bullet_black.bmp().GetSize().GetWidth();
|
||||
const auto bullet_h = bullet_black.bmp().GetSize().GetHeight();
|
||||
const auto bullet_w = bullet_black.GetWidth();
|
||||
const auto bullet_h = bullet_black.GetHeight();
|
||||
const int yoff_icon = bullet_h < em_h ? (em_h - bullet_h) / 2 : 0;
|
||||
const int yoff_text = bullet_h > em_h ? (bullet_h - em_h) / 2 : 0;
|
||||
const int yinc = item_height();
|
||||
|
|
@ -1639,10 +1639,10 @@ void ConfigWizardIndex::on_paint(wxPaintEvent & evt)
|
|||
unsigned x = em_w/2 + item.indent * em_w;
|
||||
|
||||
if (i == item_active || (item_hover >= 0 && i == (size_t)item_hover)) {
|
||||
dc.DrawBitmap(bullet_blue.bmp(), x, y + yoff_icon, false);
|
||||
dc.DrawBitmap(bullet_blue.get_bitmap(), x, y + yoff_icon, false);
|
||||
}
|
||||
else if (i < item_active) { dc.DrawBitmap(bullet_black.bmp(), x, y + yoff_icon, false); }
|
||||
else if (i > item_active) { dc.DrawBitmap(bullet_white.bmp(), x, y + yoff_icon, false); }
|
||||
else if (i < item_active) { dc.DrawBitmap(bullet_black.get_bitmap(), x, y + yoff_icon, false); }
|
||||
else if (i > item_active) { dc.DrawBitmap(bullet_white.get_bitmap(), x, y + yoff_icon, false); }
|
||||
|
||||
x += + bullet_w + em_w/2;
|
||||
const auto text_size = dc.GetTextExtent(item.label);
|
||||
|
|
@ -1655,7 +1655,7 @@ void ConfigWizardIndex::on_paint(wxPaintEvent & evt)
|
|||
|
||||
//draw logo
|
||||
if (int y = size.y - bg.GetBmpHeight(); y>=0) {
|
||||
dc.DrawBitmap(bg.bmp(), 0, y, false);
|
||||
dc.DrawBitmap(bg.get_bitmap(), 0, y, false);
|
||||
index_width = std::max(index_width, bg.GetBmpWidth() + em_w / 2);
|
||||
}
|
||||
|
||||
|
|
@ -1689,7 +1689,7 @@ void ConfigWizardIndex::msw_rescale()
|
|||
em_h = size.y;
|
||||
|
||||
bg.msw_rescale();
|
||||
SetMinSize(bg.bmp().GetSize());
|
||||
SetMinSize(bg.GetSize());
|
||||
|
||||
bullet_black.msw_rescale();
|
||||
bullet_blue.msw_rescale();
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ void ImageGrid::render(wxDC& dc)
|
|||
auto si = m_status_icon.GetBmpSize();
|
||||
auto st = dc.GetTextExtent(m_status_msg);
|
||||
auto rect = wxRect{0, 0, max(st.x, si.x), si.y + 26 + st.y}.CenterIn(wxRect({0, 0}, size));
|
||||
dc.DrawBitmap(m_status_icon.bmp(), rect.x + (rect.width - si.x) / 2, rect.y);
|
||||
dc.DrawBitmap(m_status_icon.get_bitmap(), rect.x + (rect.width - si.x) / 2, rect.y);
|
||||
dc.SetTextForeground(wxColor(0x909090));
|
||||
dc.DrawText(m_status_msg, rect.x + (rect.width - st.x) / 2, rect.GetBottom() - st.y);
|
||||
}
|
||||
|
|
@ -593,7 +593,7 @@ void Slic3r::GUI::ImageGrid::renderContent1(wxDC &dc, wxPoint const &pt, int ind
|
|||
bool show_download_state_always = true;
|
||||
// Draw checked icon
|
||||
if (m_selecting && !show_download_state_always)
|
||||
dc.DrawBitmap(selected ? m_checked_icon.bmp() : m_unchecked_icon.bmp(), pt + wxPoint{10, m_content_rect.GetHeight() - m_checked_icon.GetBmpHeight() - 10});
|
||||
dc.DrawBitmap(selected ? m_checked_icon.get_bitmap() : m_unchecked_icon.get_bitmap(), pt + wxPoint{10, m_content_rect.GetHeight() - m_checked_icon.GetBmpHeight() - 10});
|
||||
// can't handle alpha
|
||||
// dc.GradientFillLinear({pt.x, pt.y, m_border_size.GetWidth(), 60}, wxColour(0x6F, 0x6F, 0x6F, 0x99), wxColour(0x6F, 0x6F, 0x6F, 0), wxBOTTOM);
|
||||
else if (m_file_sys->GetGroupMode() == PrinterFileSystem::G_NONE) {
|
||||
|
|
@ -644,7 +644,7 @@ void Slic3r::GUI::ImageGrid::renderContent1(wxDC &dc, wxPoint const &pt, int ind
|
|||
dc.DrawText(date, pt + wxPoint{24, 16});
|
||||
}
|
||||
if (m_selecting && show_download_state_always)
|
||||
dc.DrawBitmap(selected ? m_checked_icon.bmp() : m_unchecked_icon.bmp(), pt + wxPoint{10, m_content_rect.GetHeight() - m_checked_icon.GetBmpHeight() - 10});
|
||||
dc.DrawBitmap(selected ? m_checked_icon.get_bitmap() : m_unchecked_icon.get_bitmap(), pt + wxPoint{10, m_content_rect.GetHeight() - m_checked_icon.GetBmpHeight() - 10});
|
||||
}
|
||||
|
||||
void Slic3r::GUI::ImageGrid::renderContent2(wxDC &dc, wxPoint const &pt, int index, bool hit)
|
||||
|
|
@ -736,7 +736,7 @@ void Slic3r::GUI::ImageGrid::renderText2(wxDC &dc, wxString text, wxRect const &
|
|||
|
||||
void Slic3r::GUI::ImageGrid::renderIconText(wxDC & dc, ScalableBitmap const & icon, wxString text, wxRect const & rect)
|
||||
{
|
||||
dc.DrawBitmap(icon.bmp(), rect.x, rect.y + (rect.height - icon.GetBmpHeight()) / 2);
|
||||
dc.DrawBitmap(icon.get_bitmap(), rect.x, rect.y + (rect.height - icon.GetBmpHeight()) / 2);
|
||||
renderText2(dc, text, {rect.x + icon.GetBmpWidth() + 4, rect.y, rect.width - icon.GetBmpWidth() - 4, rect.height});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ void RecenterDialog::render(wxDC& dc) {
|
|||
|
||||
wxPoint pos_bmp = pos_start;
|
||||
pos_bmp.x += hint1_size.x;
|
||||
dc.DrawBitmap(m_home_bmp.bmp(), pos_bmp);
|
||||
dc.DrawBitmap(m_home_bmp.get_bitmap(), pos_bmp);
|
||||
|
||||
wxSize hint2_size = dc.GetTextExtent(hint2);
|
||||
wxPoint pos_hint2 = pos_hint1;
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ void MachineObjectPanel::doRender(wxDC &dc)
|
|||
if (m_state == PrinterState::IN_LAN) { dwbitmap = m_printer_in_lan; }
|
||||
|
||||
// dc.DrawCircle(left, size.y / 2, 3);
|
||||
dc.DrawBitmap(dwbitmap.bmp(), wxPoint(left, (size.y - dwbitmap.GetBmpSize().y) / 2));
|
||||
dc.DrawBitmap(dwbitmap.get_bitmap(), wxPoint(left, (size.y - dwbitmap.GetBmpSize().y) / 2));
|
||||
|
||||
left += dwbitmap.GetBmpSize().x + 8;
|
||||
dc.SetFont(Label::Body_13);
|
||||
|
|
@ -259,13 +259,13 @@ void MachineObjectPanel::doRender(wxDC &dc)
|
|||
if (m_show_bind) {
|
||||
if (m_bind_state == ALLOW_UNBIND) {
|
||||
left = size.x - m_unbind_img.GetBmpSize().x - 6;
|
||||
dc.DrawBitmap(m_unbind_img.bmp(), left, (size.y - m_unbind_img.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(m_unbind_img.get_bitmap(), left, (size.y - m_unbind_img.GetBmpSize().y) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_show_edit) {
|
||||
left = size.x - m_unbind_img.GetBmpSize().x - 6 - m_edit_name_img.GetBmpSize().x - 6;
|
||||
dc.DrawBitmap(m_edit_name_img.bmp(), left, (size.y - m_edit_name_img.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(m_edit_name_img.get_bitmap(), left, (size.y - m_edit_name_img.GetBmpSize().y) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ void TabButton::render(wxDC &dc)
|
|||
if (icon.bmp().IsOk()) {
|
||||
pt.x = size.x - icon.GetBmpWidth() - paddingSize.y;
|
||||
pt.y = (size.y - icon.GetBmpHeight()) / 2;
|
||||
dc.DrawBitmap(icon.bmp(), pt);
|
||||
dc.DrawBitmap(icon.get_bitmap(), pt);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ void AMSrefresh::paintEvent(wxPaintEvent &evt)
|
|||
|
||||
if (!m_disable_mode) {
|
||||
if (!m_play_loading) {
|
||||
dc.DrawBitmap(m_selected ? m_bitmap_selected.bmp() : m_bitmap_normal.bmp(), pot);
|
||||
dc.DrawBitmap(m_selected ? m_bitmap_selected.get_bitmap() : m_bitmap_normal.get_bitmap(), pot);
|
||||
}
|
||||
else {
|
||||
/* m_bitmap_rotation = ScalableBitmap(this, "ams_refresh_normal", 30);
|
||||
|
|
@ -249,7 +249,7 @@ void AMSrefresh::paintEvent(wxPaintEvent &evt)
|
|||
m_rotation_angle = 0;
|
||||
}
|
||||
if (m_rfid_bitmap_list.size() <= 0)return;
|
||||
dc.DrawBitmap(m_rfid_bitmap_list[m_rotation_angle].bmp(), pot);
|
||||
dc.DrawBitmap(m_rfid_bitmap_list[m_rotation_angle].get_bitmap(), pot);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ void AMSextruderImage::doRender(wxDC &dc)
|
|||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.SetBrush(m_colour);
|
||||
dc.DrawRectangle(0, FromDIP(18), size.x, size.y - FromDIP(18) - FromDIP(5));
|
||||
dc.DrawBitmap(m_ams_extruder.bmp(), wxPoint((size.x - m_ams_extruder.GetBmpSize().x) / 2, (size.y - m_ams_extruder.GetBmpSize().y) / 2));
|
||||
dc.DrawBitmap(m_ams_extruder.get_bitmap(), wxPoint((size.x - m_ams_extruder.GetBmpSize().x) / 2, (size.y - m_ams_extruder.GetBmpSize().y) / 2));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1015,21 +1015,21 @@ void AMSLib::render_extra_lib(wxDC& dc)
|
|||
if (m_info.material_state != AMSCanType::AMS_CAN_TYPE_EMPTY && m_info.material_state != AMSCanType::AMS_CAN_TYPE_NONE)
|
||||
{
|
||||
if (m_info.material_state == AMSCanType::AMS_CAN_TYPE_THIRDBRAND || m_info.material_state == AMSCanType::AMS_CAN_TYPE_VIRTUAL)
|
||||
dc.DrawBitmap(temp_bitmap_third.bmp(), (size.x - temp_bitmap_third.GetBmpSize().x) / 2 + FromDIP(2), (size.y - FromDIP(18) - temp_bitmap_third.GetBmpSize().y));
|
||||
dc.DrawBitmap(temp_bitmap_third.get_bitmap(), (size.x - temp_bitmap_third.GetBmpSize().x) / 2 + FromDIP(2), (size.y - FromDIP(18) - temp_bitmap_third.GetBmpSize().y));
|
||||
if (m_info.material_state == AMSCanType::AMS_CAN_TYPE_BRAND)
|
||||
dc.DrawBitmap(temp_bitmap_brand.bmp(), (size.x - temp_bitmap_brand.GetBmpSize().x) / 2 + FromDIP(2), (size.y - FromDIP(18) - temp_bitmap_brand.GetBmpSize().y));
|
||||
dc.DrawBitmap(temp_bitmap_brand.get_bitmap(), (size.x - temp_bitmap_brand.GetBmpSize().x) / 2 + FromDIP(2), (size.y - FromDIP(18) - temp_bitmap_brand.GetBmpSize().y));
|
||||
}
|
||||
}
|
||||
|
||||
// selected & hover
|
||||
if (m_selected) {
|
||||
dc.DrawBitmap(tray_bitmap_selected.bmp(), (size.x - tray_bitmap_selected.GetBmpSize().x) / 2, (size.y - tray_bitmap_selected.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(tray_bitmap_selected.get_bitmap(), (size.x - tray_bitmap_selected.GetBmpSize().x) / 2, (size.y - tray_bitmap_selected.GetBmpSize().y) / 2);
|
||||
}
|
||||
else if (!m_selected && m_hover) {
|
||||
dc.DrawBitmap(tray_bitmap_hover.bmp(), (size.x - tray_bitmap_hover.GetBmpSize().x) / 2, (size.y - tray_bitmap_hover.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(tray_bitmap_hover.get_bitmap(), (size.x - tray_bitmap_hover.GetBmpSize().x) / 2, (size.y - tray_bitmap_hover.GetBmpSize().y) / 2);
|
||||
}
|
||||
else {
|
||||
dc.DrawBitmap(tray_bitmap.bmp(), (size.x - tray_bitmap.GetBmpSize().x) / 2, (size.y - tray_bitmap.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(tray_bitmap.get_bitmap(), (size.x - tray_bitmap.GetBmpSize().x) / 2, (size.y - tray_bitmap.GetBmpSize().y) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1109,7 +1109,7 @@ void AMSLib::render_generic_lib(wxDC &dc)
|
|||
//transparent
|
||||
auto alpha = m_info.material_colour.Alpha();
|
||||
if (alpha == 0) {
|
||||
dc.DrawBitmap(m_bitmap_transparent.bmp(), FromDIP(4), FromDIP(4));
|
||||
dc.DrawBitmap(m_bitmap_transparent.get_bitmap(), FromDIP(4), FromDIP(4));
|
||||
}
|
||||
|
||||
//gradient
|
||||
|
|
@ -1180,9 +1180,9 @@ void AMSLib::render_generic_lib(wxDC &dc)
|
|||
if (m_info.material_state != AMSCanType::AMS_CAN_TYPE_EMPTY && m_info.material_state != AMSCanType::AMS_CAN_TYPE_NONE)
|
||||
{
|
||||
if (m_info.material_state == AMSCanType::AMS_CAN_TYPE_THIRDBRAND || m_info.material_state == AMSCanType::AMS_CAN_TYPE_VIRTUAL)
|
||||
dc.DrawBitmap(temp_bitmap_third.bmp(), (size.x - temp_bitmap_third.GetBmpSize().x) / 2, (size.y - FromDIP(10) - temp_bitmap_third.GetBmpSize().y));
|
||||
dc.DrawBitmap(temp_bitmap_third.get_bitmap(), (size.x - temp_bitmap_third.GetBmpSize().x) / 2, (size.y - FromDIP(10) - temp_bitmap_third.GetBmpSize().y));
|
||||
if (m_info.material_state == AMSCanType::AMS_CAN_TYPE_BRAND)
|
||||
dc.DrawBitmap(temp_bitmap_brand.bmp(), (size.x - temp_bitmap_brand.GetBmpSize().x) / 2, (size.y - FromDIP(10) - temp_bitmap_brand.GetBmpSize().y));
|
||||
dc.DrawBitmap(temp_bitmap_brand.get_bitmap(), (size.x - temp_bitmap_brand.GetBmpSize().x) / 2, (size.y - FromDIP(10) - temp_bitmap_brand.GetBmpSize().y));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1445,20 +1445,20 @@ void AMSRoad::doRender(wxDC &dc)
|
|||
else {m_show_humidity = false;}
|
||||
|
||||
if (m_amsinfo.ams_humidity == 5) {
|
||||
dc.DrawBitmap(ams_humidity_4.bmp(), wxPoint(size.x - ams_humidity_4.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_4.GetBmpSize().y - FromDIP(8)));
|
||||
dc.DrawBitmap(ams_humidity_4.get_bitmap(), wxPoint(size.x - ams_humidity_4.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_4.GetBmpSize().y - FromDIP(8)));
|
||||
}
|
||||
else if (m_amsinfo.ams_humidity == 4) {
|
||||
dc.DrawBitmap(ams_humidity_3.bmp(), wxPoint(size.x - ams_humidity_3.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_3.GetBmpSize().y - FromDIP(8)));
|
||||
dc.DrawBitmap(ams_humidity_3.get_bitmap(), wxPoint(size.x - ams_humidity_3.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_3.GetBmpSize().y - FromDIP(8)));
|
||||
}
|
||||
else if (m_amsinfo.ams_humidity == 3) {
|
||||
|
||||
dc.DrawBitmap(ams_humidity_2.bmp(), wxPoint(size.x - ams_humidity_2.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_2.GetBmpSize().y - FromDIP(8)));
|
||||
dc.DrawBitmap(ams_humidity_2.get_bitmap(), wxPoint(size.x - ams_humidity_2.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_2.GetBmpSize().y - FromDIP(8)));
|
||||
}
|
||||
else if (m_amsinfo.ams_humidity == 2) {
|
||||
dc.DrawBitmap(ams_humidity_1.bmp(), wxPoint(size.x - ams_humidity_1.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_1.GetBmpSize().y - FromDIP(8)));
|
||||
dc.DrawBitmap(ams_humidity_1.get_bitmap(), wxPoint(size.x - ams_humidity_1.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_1.GetBmpSize().y - FromDIP(8)));
|
||||
}
|
||||
else if (m_amsinfo.ams_humidity == 1) {
|
||||
dc.DrawBitmap(ams_humidity_0.bmp(), wxPoint(size.x - ams_humidity_0.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_0.GetBmpSize().y - FromDIP(8)));
|
||||
dc.DrawBitmap(ams_humidity_0.get_bitmap(), wxPoint(size.x - ams_humidity_0.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_0.GetBmpSize().y - FromDIP(8)));
|
||||
}
|
||||
else {
|
||||
/*dc.DrawBitmap(ams_humidity_4.bmp(), wxPoint(size.x - ams_humidity_4.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_4.GetBmpSize().y - FromDIP(8)));*/
|
||||
|
|
@ -1655,7 +1655,7 @@ void AMSItem::doRender(wxDC &dc)
|
|||
|
||||
}else {
|
||||
if (iter->material_colour.Alpha() == 0) {
|
||||
dc.DrawBitmap(m_ts_bitmap_cube->bmp(),left,(size.y - AMS_ITEM_CUBE_SIZE.y) / 2);
|
||||
dc.DrawBitmap(m_ts_bitmap_cube->get_bitmap(),left,(size.y - AMS_ITEM_CUBE_SIZE.y) / 2);
|
||||
}
|
||||
else {
|
||||
wxRect rect(left, (size.y - AMS_ITEM_CUBE_SIZE.y) / 2, AMS_ITEM_CUBE_SIZE.x, AMS_ITEM_CUBE_SIZE.y);
|
||||
|
|
@ -2084,7 +2084,7 @@ void AmsCans::render(wxDC& dc)
|
|||
void AmsCans::doRender(wxDC& dc)
|
||||
{
|
||||
wxSize size = GetSize();
|
||||
dc.DrawBitmap(m_bitmap_extra_framework.bmp(), (size.x - m_bitmap_extra_framework.GetBmpSize().x) / 2, (size.y - m_bitmap_extra_framework.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(m_bitmap_extra_framework.get_bitmap(), (size.x - m_bitmap_extra_framework.GetBmpSize().x) / 2, (size.y - m_bitmap_extra_framework.GetBmpSize().y) / 2);
|
||||
|
||||
//road for extra
|
||||
if (m_ams_model == AMSModel::EXTRA_AMS) {
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ void AxisCtrlButton::render(wxDC& dc)
|
|||
gc->DrawPath(home_path);
|
||||
|
||||
if (m_icon.bmp().IsOk()) {
|
||||
gc->DrawBitmap(m_icon.bmp(), -1 * m_icon.GetBmpWidth() / 2, -1 * m_icon.GetBmpHeight() / 2, m_icon.GetBmpWidth(), m_icon.GetBmpHeight());
|
||||
gc->DrawBitmap(m_icon.get_bitmap(), -1 * m_icon.GetBmpWidth() / 2, -1 * m_icon.GetBmpHeight() / 2, m_icon.GetBmpWidth(), m_icon.GetBmpHeight());
|
||||
}
|
||||
gc->PopState();
|
||||
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ void Button::render(wxDC& dc)
|
|||
wxPoint pt = rcContent.GetLeftTop();
|
||||
if (icon.bmp().IsOk()) {
|
||||
pt.y += (rcContent.height - szIcon.y) / 2;
|
||||
dc.DrawBitmap(icon.bmp(), pt);
|
||||
dc.DrawBitmap(icon.get_bitmap(), pt);
|
||||
//BBS norrow size between text and icon
|
||||
pt.x += szIcon.x + padding;
|
||||
pt.y = rcContent.y;
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ void DropDown::render(wxDC &dc)
|
|||
pt.y += (rcContent.height - szBmp.y) / 2;
|
||||
pt.y += rowSize.y * selection;
|
||||
if (pt.y + szBmp.y > 0 && pt.y < size.y)
|
||||
dc.DrawBitmap(check_bitmap.bmp(), pt);
|
||||
dc.DrawBitmap(check_bitmap.get_bitmap(), pt);
|
||||
}
|
||||
rcContent.x += szBmp.x + 5;
|
||||
rcContent.width -= szBmp.x + 5;
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ void Fan::doRender(wxDC& dc)
|
|||
auto rpm = wxT("rpm");
|
||||
|
||||
wxSize size = GetSize();
|
||||
dc.DrawBitmap(m_bitmap_bk.bmp(), wxPoint(0,0));
|
||||
dc.DrawBitmap(m_bitmap_bk.get_bitmap(), wxPoint(0,0));
|
||||
|
||||
//fan scale
|
||||
/*auto central_point = wxPoint(size.x / 2, size.y / 2 + FromDIP(15));
|
||||
|
|
@ -134,7 +134,7 @@ void Fan::doRender(wxDC& dc)
|
|||
//auto pointer_central_point = wxPoint((size.x - m_img_pointer.GetSize().x) / 2, (size.y - m_img_pointer.GetSize().y) / 2);
|
||||
//auto bmp = m_img_pointer.Rotate(m_rotate_offsets[m_current_speeds].rotate, wxPoint(size.x / 2,size.y / 2));
|
||||
auto central_point = wxPoint((size.x - m_bitmap_scales[m_current_speeds].GetBmpSize().x) / 2, (size.y - m_bitmap_scales[m_current_speeds].GetBmpSize().y) / 2 - FromDIP(4));
|
||||
dc.DrawBitmap(m_bitmap_scales[m_current_speeds].bmp(), central_point.x, central_point.y);
|
||||
dc.DrawBitmap(m_bitmap_scales[m_current_speeds].get_bitmap(), central_point.x, central_point.y);
|
||||
|
||||
//fan val
|
||||
dc.SetTextForeground(DRAW_TEXT_COLOUR);
|
||||
|
|
@ -280,8 +280,8 @@ void FanOperate::doRender(wxDC& dc)
|
|||
dc.DrawLine(left_fir, FromDIP(4), left_fir, size.y - FromDIP(4));
|
||||
dc.DrawLine(left_fir * 2, FromDIP(4), left_fir * 2, size.y - FromDIP(4));
|
||||
|
||||
dc.DrawBitmap(m_bitmap_decrease.bmp(), (left_fir - m_bitmap_decrease.GetBmpSize().x) / 2, (size.y - m_bitmap_decrease.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(m_bitmap_add.bmp(), (left_fir * 2 + (left_fir - m_bitmap_decrease.GetBmpSize().x) / 2), (size.y - m_bitmap_add.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(m_bitmap_decrease.get_bitmap(), (left_fir - m_bitmap_decrease.GetBmpSize().x) / 2, (size.y - m_bitmap_decrease.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(m_bitmap_add.get_bitmap(), (left_fir * 2 + (left_fir - m_bitmap_decrease.GetBmpSize().x) / 2), (size.y - m_bitmap_add.GetBmpSize().y) / 2);
|
||||
|
||||
//txt
|
||||
dc.SetFont(::Label::Body_12);
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ void ImageSwitchButton::render(wxDC& dc)
|
|||
|
||||
wxPoint pt = wxPoint((size.x - icon.GetBmpWidth()) / 2, (size.y - content_height) / 2);
|
||||
if (icon.bmp().IsOk()) {
|
||||
dc.DrawBitmap(icon.bmp(), pt);
|
||||
dc.DrawBitmap(icon.get_bitmap(), pt);
|
||||
pt.y += m_padding + icon.GetBmpHeight();
|
||||
}
|
||||
pt.x = (size.x - textSize.x) / 2;
|
||||
|
|
@ -300,7 +300,7 @@ void FanSwitchButton::render(wxDC& dc)
|
|||
|
||||
pt = wxPoint((size.x - icon.GetBmpWidth()) / 2, content_height + textSize.y);
|
||||
if (icon.bmp().IsOk()) {
|
||||
dc.DrawBitmap(icon.bmp(), pt);
|
||||
dc.DrawBitmap(icon.get_bitmap(), pt);
|
||||
pt.y += m_padding + icon.GetBmpHeight();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ void SideButton::dorender(wxDC& dc, wxDC& text_dc)
|
|||
//BBS extra pixels for icon
|
||||
pt.x += icon_offset;
|
||||
pt.y += (rcContent.height - szIcon.y) / 2;
|
||||
dc.DrawBitmap(icon.bmp(), pt);
|
||||
dc.DrawBitmap(icon.get_bitmap(), pt);
|
||||
//BBS norrow size between text and icon
|
||||
pt.x += szIcon.x + 5;
|
||||
pt.y = rcContent.y;
|
||||
|
|
|
|||
|
|
@ -138,10 +138,10 @@ void SideToolsPanel::doRender(wxDC &dc)
|
|||
dc.SetBrush(SIDE_TOOLS_BRAND);
|
||||
dc.DrawRectangle(0, 0, size.x, size.y);
|
||||
|
||||
dc.DrawBitmap(m_none_printing_img.bmp(), left, (size.y - m_none_printing_img.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(m_none_printing_img.get_bitmap(), left, (size.y - m_none_printing_img.GetBmpSize().y) / 2);
|
||||
|
||||
left += (m_none_printing_img.GetBmpSize().x + FromDIP(15));
|
||||
dc.DrawBitmap(m_none_arrow_img.bmp(), left, (size.y - m_none_arrow_img.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(m_none_arrow_img.get_bitmap(), left, (size.y - m_none_arrow_img.GetBmpSize().y) / 2);
|
||||
|
||||
left += (m_none_arrow_img.GetBmpSize().x + FromDIP(6));
|
||||
dc.SetFont(::Label::Body_14);
|
||||
|
|
@ -170,12 +170,12 @@ void SideToolsPanel::doRender(wxDC &dc)
|
|||
dc.DrawText(no_printer_str, wxPoint(left, (size.y - sizet.y) / 2));
|
||||
|
||||
left = size.x - FromDIP(30) - m_wifi_none_img.GetBmpSize().x;
|
||||
dc.DrawBitmap(m_none_add_img.bmp(), left, (size.y - m_none_add_img.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(m_none_add_img.get_bitmap(), left, (size.y - m_none_add_img.GetBmpSize().y) / 2);
|
||||
} else {
|
||||
dc.DrawBitmap(m_printing_img.bmp(), left, (size.y - m_printing_img.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(m_printing_img.get_bitmap(), left, (size.y - m_printing_img.GetBmpSize().y) / 2);
|
||||
|
||||
left += (m_printing_img.GetBmpSize().x + FromDIP(5));
|
||||
dc.DrawBitmap(m_arrow_img.bmp(), left, (size.y - m_arrow_img.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(m_arrow_img.get_bitmap(), left, (size.y - m_arrow_img.GetBmpSize().y) / 2);
|
||||
|
||||
left += (m_arrow_img.GetBmpSize().x + FromDIP(6));
|
||||
dc.SetFont(::Label::Body_14);
|
||||
|
|
@ -201,11 +201,11 @@ void SideToolsPanel::doRender(wxDC &dc)
|
|||
dc.DrawText(finally_name, wxPoint(left, (size.y - sizet.y) / 2));
|
||||
|
||||
left = size.x - FromDIP(18) - m_wifi_none_img.GetBmpSize().x;
|
||||
if (m_wifi_type == WifiSignal::NONE) dc.DrawBitmap(m_wifi_none_img.bmp(), left, (size.y - m_wifi_none_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::WEAK) dc.DrawBitmap(m_wifi_weak_img.bmp(), left, (size.y - m_wifi_weak_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::MIDDLE) dc.DrawBitmap(m_wifi_middle_img.bmp(), left, (size.y - m_wifi_middle_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::STRONG) dc.DrawBitmap(m_wifi_strong_img.bmp(), left, (size.y - m_wifi_strong_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::WIRED) dc.DrawBitmap(m_network_wired_img.bmp(), left, (size.y - m_network_wired_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::NONE) dc.DrawBitmap(m_wifi_none_img.get_bitmap(), left, (size.y - m_wifi_none_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::WEAK) dc.DrawBitmap(m_wifi_weak_img.get_bitmap(), left, (size.y - m_wifi_weak_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::MIDDLE) dc.DrawBitmap(m_wifi_middle_img.get_bitmap(), left, (size.y - m_wifi_middle_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::STRONG) dc.DrawBitmap(m_wifi_strong_img.get_bitmap(), left, (size.y - m_wifi_strong_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::WIRED) dc.DrawBitmap(m_network_wired_img.get_bitmap(), left, (size.y - m_network_wired_img.GetBmpSize().y) / 2);
|
||||
}
|
||||
|
||||
if (m_hover) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void StaticLine::render(wxDC& dc)
|
|||
textSize.GetWidth();
|
||||
if (vertical) titleRect.Deflate((size.GetWidth() - contentWidth) / 2, 0);
|
||||
if (icon.bmp().IsOk()) {
|
||||
dc.DrawBitmap(icon.bmp(), {0, (size.y - icon.GetBmpHeight()) / 2});
|
||||
dc.DrawBitmap(icon.get_bitmap(), {0, (size.y - icon.GetBmpHeight()) / 2});
|
||||
titleRect.x += icon.GetBmpWidth() + 5;
|
||||
}
|
||||
if (!label.IsEmpty()) {
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ void StepCtrl::doRender(wxDC &dc)
|
|||
wxSize sz = dc.GetTextExtent(tips[i]);
|
||||
dc.DrawText(tips[i], circleX - sz.x / 2, circleY - 20 - sz.y);
|
||||
sz = bmp_thumb.GetBmpSize();
|
||||
dc.DrawBitmap(bmp_thumb.bmp(), circleX - sz.x / 2, circleY - sz.y / 2);
|
||||
dc.DrawBitmap(bmp_thumb.get_bitmap(), circleX - sz.x / 2, circleY - sz.y / 2);
|
||||
}
|
||||
circleX += itemWidth;
|
||||
}
|
||||
|
|
@ -320,7 +320,7 @@ void StepIndicator::doRender(wxDC &dc)
|
|||
// Draw content ( icon or text ) in circle
|
||||
if (disabled) {
|
||||
wxSize sz = bmp_ok.GetBmpSize();
|
||||
dc.DrawBitmap(bmp_ok.bmp(), circleX - radius, circleY - radius);
|
||||
dc.DrawBitmap(bmp_ok.get_bitmap(), circleX - radius, circleY - radius);
|
||||
} else {
|
||||
dc.SetFont(font_tip);
|
||||
dc.SetTextForeground(clr_tip.colorForStates(states));
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ void TempInput::render(wxDC &dc)
|
|||
if (actice_icon.bmp().IsOk() && actice) {
|
||||
wxSize szIcon = actice_icon.GetBmpSize();
|
||||
pt.y = (size.y - szIcon.y) / 2;
|
||||
dc.DrawBitmap(actice_icon.bmp(), pt);
|
||||
dc.DrawBitmap(actice_icon.get_bitmap(), pt);
|
||||
pt.x += szIcon.x + 9;
|
||||
} else {
|
||||
actice = false;
|
||||
|
|
@ -390,7 +390,7 @@ void TempInput::render(wxDC &dc)
|
|||
if (normal_icon.bmp().IsOk() && !actice) {
|
||||
wxSize szIcon = normal_icon.GetBmpSize();
|
||||
pt.y = (size.y - szIcon.y) / 2;
|
||||
dc.DrawBitmap(normal_icon.bmp(), pt);
|
||||
dc.DrawBitmap(normal_icon.get_bitmap(), pt);
|
||||
pt.x += szIcon.x + 9;
|
||||
}
|
||||
|
||||
|
|
@ -438,7 +438,7 @@ void TempInput::render(wxDC &dc)
|
|||
wxSize szIcon = degree_icon.GetBmpSize();
|
||||
pt.y = (size.y - szIcon.y) / 2;
|
||||
pt.x = pos.x + text_ctrl->GetSize().x;
|
||||
dc.DrawBitmap(degree_icon.bmp(), pt);
|
||||
dc.DrawBitmap(degree_icon.get_bitmap(), pt);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ void TextInput::render(wxDC& dc)
|
|||
if (icon.bmp().IsOk()) {
|
||||
wxSize szIcon = icon.GetBmpSize();
|
||||
pt.y = (size.y - szIcon.y) / 2;
|
||||
dc.DrawBitmap(icon.bmp(), pt);
|
||||
dc.DrawBitmap(icon.get_bitmap(), pt);
|
||||
pt.x += szIcon.x + 0;
|
||||
}
|
||||
auto text = wxWindow::GetLabel();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue