Line 27... |
Line 27... |
27 |
{
|
27 |
{
|
28 |
public:
|
28 |
public:
|
29 |
TDrawImage();
|
29 |
TDrawImage();
|
30 |
~TDrawImage();
|
30 |
~TDrawImage();
|
31 |
|
31 |
|
- |
|
32 |
/**
|
- |
|
33 |
* \brief Draws an image used as the background of a page or subpage.
|
- |
|
34 |
* This method can draw a normal or a cameleon image. It is able to
|
- |
|
35 |
* detect which kind of image to draw.
|
- |
|
36 |
*
|
- |
|
37 |
* @param bm A pointer to the target image. The new image will be
|
- |
|
38 |
* drawn on top of \p bm.
|
- |
|
39 |
*
|
- |
|
40 |
* @return If everything went well TRUE is returned. Otherwise FALSE.
|
- |
|
41 |
* If there was an error it is documented into the logfile if the
|
- |
|
42 |
* loglevel ERROR and WARNING was set.
|
- |
|
43 |
*/
|
32 |
bool drawImage(SkBitmap* bm);
|
44 |
bool drawImage(SkBitmap* bm);
|
33 |
|
45 |
|
34 |
void setInstance(int instance) { mInstance = instance; }
|
46 |
void setInstance(int instance) { mInstance = instance; } // Set the instance to use (always 0 for background images)
|
35 |
int getInstance() { return mInstance; }
|
47 |
int getInstance() { return mInstance; } // Get the instance in use
|
36 |
void setSr(std::vector<Button::SR_T>& sr) { mSr = sr; }
|
48 |
void setSr(std::vector<Button::SR_T>& sr) { mSr = sr; } // Set the page resource
|
37 |
std::vector<Button::SR_T>& getSr() { return mSr; }
|
49 |
std::vector<Button::SR_T>& getSr() { return mSr; } // Get the page resource
|
38 |
void setImageMi(SkBitmap& mi) { imageMi = mi; }
|
50 |
void setImageMi(SkBitmap& mi) { imageMi = mi; } // Set the optional image mask for a cameleon image
|
39 |
SkBitmap& getImageMi() { return imageMi; }
|
51 |
SkBitmap& getImageMi() { return imageMi; } // Get the image mask
|
40 |
void setImageBm(SkBitmap& bm) { imageBm = bm; }
|
52 |
void setImageBm(SkBitmap& bm) { imageBm = bm; } // Set the optional bitmap
|
41 |
SkBitmap& getImageBm() { return imageBm; }
|
53 |
SkBitmap& getImageBm() { return imageBm; } // Get the bitmap
|
42 |
void setBorderSize(int bs) { mBorderSize = bs; }
|
54 |
void setBorderSize(int bs) { mBorderSize = bs; } // Set the optional border size, if there is one
|
43 |
int getBorderSize() { return mBorderSize; }
|
55 |
int getBorderSize() { return mBorderSize; } // Get the border size
|
44 |
void setWidth(int wt) { mWidth = wt; }
|
56 |
void setWidth(int wt) { mWidth = wt; } // Set the total width (width of page or subpage)
|
45 |
int getWidth() { return mWidth; }
|
57 |
int getWidth() { return mWidth; } // Get the total width
|
46 |
void setHeight(int ht) { mHeight = ht; }
|
58 |
void setHeight(int ht) { mHeight = ht; } // Set the total height (height of page or subpage)
|
47 |
int getHeight() { return mHeight; }
|
59 |
int getHeight() { return mHeight; } // Get the total height
|
48 |
|
60 |
|
49 |
private:
|
61 |
private:
|
50 |
SkBitmap drawImageButton(SkBitmap& imgRed, SkBitmap& imgMask, int width, int height, SkColor col1, SkColor col2);
|
62 |
SkBitmap drawImageButton(SkBitmap& imgRed, SkBitmap& imgMask, int width, int height, SkColor col1, SkColor col2);
|
51 |
SkColor baseColor(SkColor basePix, SkColor maskPix, SkColor col1, SkColor col2);
|
63 |
SkColor baseColor(SkColor basePix, SkColor maskPix, SkColor col1, SkColor col2);
|
52 |
Button::POSITION_t calcImagePosition(int width, int height, int number, int line = 0);
|
64 |
Button::POSITION_t calcImagePosition(int width, int height, int number);
|
53 |
|
65 |
|
54 |
int mInstance{0};
|
66 |
int mInstance{0}; // The instance
|
55 |
int mBorderSize{0};
|
67 |
int mBorderSize{0}; // Border size
|
56 |
int mWidth;
|
68 |
int mWidth{0}; // Total width of page / subpage
|
57 |
int mHeight;
|
69 |
int mHeight{0}; // Total height of page / subpage
|
58 |
std::vector<Button::SR_T> mSr;
|
70 |
std::vector<Button::SR_T> mSr; // Array with background definations
|
59 |
SkBitmap imageMi;
|
71 |
SkBitmap imageMi; // The mask image
|
60 |
SkBitmap imageBm;
|
72 |
SkBitmap imageBm; // The bitmap image
|
61 |
};
|
73 |
};
|
62 |
|
74 |
|
63 |
#endif
|
75 |
#endif
|