diff options
Diffstat (limited to 'include/GtkScaledImage.hpp')
-rw-r--r-- | include/GtkScaledImage.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/GtkScaledImage.hpp b/include/GtkScaledImage.hpp new file mode 100644 index 0000000..ceb0b7d --- /dev/null +++ b/include/GtkScaledImage.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include <dchat/StaticImage.hpp> +#include <cairomm/context.h> +#include <cairomm/surface.h> +#include <gdkmm/pixbuf.h> +#include <stdexcept> + +namespace dchat +{ + class GtkScaledImageException : public std::runtime_error + { + public: + GtkScaledImageException(const std::string &errMsg) : std::runtime_error(errMsg) {} + }; + + class GtkScaledImage : public StaticImage + { + public: + // Throws GtkScaledImageException on error + GtkScaledImage(const boost::filesystem::path &filepath); + virtual ~GtkScaledImage(){} + void draw(const Cairo::RefPtr<Cairo::Context> &cairo, int width, int height, bool circularMask); + private: + Cairo::RefPtr<Cairo::ImageSurface> surface; + }; +}
\ No newline at end of file |