ochess/src/binres/binres.cpp

33 lines
985 B
C++
Raw Normal View History

2022-02-23 18:11:55 +01:00
#include "binres.hpp"
// Embedded binary data (e.g: PGNs icons):
#include "binary_data.hpp"
2023-05-10 10:49:31 +02:00
2022-02-23 18:11:55 +01:00
wxBitmap LoadPNG(std::string icon, wxSize size) {
wxImage img = LoadPNG(icon).ConvertToImage();
return (wxBitmap(
img.Scale(size.GetWidth(), size.GetHeight(), wxIMAGE_QUALITY_HIGH)));
}
wxBitmap LoadPNG(std::string icon) {
if (icon == "swap") {
2023-05-09 21:59:35 +02:00
return (wxBITMAP_PNG_FROM_DATA(swap));
2022-02-23 18:11:55 +01:00
} else if (icon == "zoomin") {
2023-05-09 21:59:35 +02:00
return (wxBITMAP_PNG_FROM_DATA(zoomin));
2022-02-23 18:11:55 +01:00
} else if (icon == "zoomout") {
2023-05-09 21:59:35 +02:00
return (wxBITMAP_PNG_FROM_DATA(zoomout));
2022-02-23 18:11:55 +01:00
} else if (icon == "cburnett") {
2023-05-09 21:59:35 +02:00
return (wxBITMAP_PNG_FROM_DATA(cburnett));
2022-02-23 18:11:55 +01:00
} else if (icon == "chesscom_8bits") {
2023-05-09 21:59:35 +02:00
return (wxBITMAP_PNG_FROM_DATA(chesscom_8bits));
2022-02-23 18:11:55 +01:00
} else if (icon == "hide") {
2023-05-09 21:59:35 +02:00
return (wxBITMAP_PNG_FROM_DATA(hide));
2023-01-02 10:56:27 +01:00
} else if (icon == "mat") {
2023-05-09 21:59:35 +02:00
return (wxBITMAP_PNG_FROM_DATA(mat));
2023-02-02 08:56:46 +01:00
} else if (icon == "ochess") {
2023-05-09 21:59:35 +02:00
return (wxBITMAP_PNG_FROM_DATA(ochess));
2022-02-23 18:11:55 +01:00
}
return (wxNullBitmap);
2023-01-16 14:55:48 +01:00
}