aboutsummaryrefslogtreecommitdiff
path: root/src/binres/binres.cpp
blob: 9661b08b324a249ac23dbd499f1761c1ecb7923a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "binres.hpp"

// Embedded PGNs:
#include "swap_png.hpp"
#include "zoomin_png.hpp"
#include "zoomout_png.hpp"
#include "cburnett_png.hpp"
#include "chesscom_8bits_png.hpp"
#include "hide_png.hpp"
#include "mat_png.hpp"
#include "ochess_png.hpp"

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") {
    return (wxBITMAP_PNG_FROM_DATA(swap));
  } else if (icon == "zoomin") {
    return (wxBITMAP_PNG_FROM_DATA(zoomin));
  } else if (icon == "zoomout") {
    return (wxBITMAP_PNG_FROM_DATA(zoomout));
  } else if (icon == "cburnett") {
    return (wxBITMAP_PNG_FROM_DATA(cburnett));
  } else if (icon == "chesscom_8bits") {
    return (wxBITMAP_PNG_FROM_DATA(chesscom_8bits));
  } else if (icon == "hide") {
    return (wxBITMAP_PNG_FROM_DATA(hide));
  } else if (icon == "mat") {
    return (wxBITMAP_PNG_FROM_DATA(mat));
  } else if (icon == "ochess") {
    return (wxBITMAP_PNG_FROM_DATA(ochess));
  }
  return (wxNullBitmap);
}