2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
20 * @brief This is the header file for the %Canvas class.
22 * This header file contains the declarations of the %Canvas class.
26 #ifndef _FGRP_CANVAS_H_
27 #define _FGRP_CANVAS_H_
30 #include <FBaseObject.h>
31 #include <FBaseColArrayListT.h>
32 #include <FGrpRectangle.h>
33 #include <FGrpFloatRectangle.h>
34 #include <FGrpColor.h>
35 #include <FGrpPixelFormat.h>
36 #include <FGrpBufferInfo.h>
37 #include <FGrpBitmap.h>
38 #include <FGrpCanvasCommon.h>
40 namespace Tizen { namespace Graphics
47 * @brief This class provides methods for drawing objects.
51 * @final This class is not intended for extension.
53 * The %Canvas class provides a rectangular region to draw objects on the display device. The %Canvas instance is
54 * associated with a specific context.
56 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/graphics/canvas.htm">Canvas</a>.
59 class _OSP_EXPORT_ Canvas
60 : public Tizen::Base::Object
64 * This is the default constructor for this class.
67 * @remarks After creating an instance of this class, one of the Construct() methods must be
68 * called explicitly to initialize this instance.
73 * This is the destructor for this class.
77 virtual ~Canvas(void);
80 * Initializes this instance of %Canvas to create a canvas control of the same size as that of the
85 * @return An error code
86 * @exception E_SUCCESS The method is successful.
87 * @exception E_OUT_OF_MEMORY The memory is insufficient.
89 result Construct(void);
92 * Initializes this instance of %Canvas with the specified parameter.
96 * @return An error code
97 * @param[in] rect The location and size of the canvas control on the device screen @n
98 * The width and height of the rectangle must be greater than @c 0.
99 * If this condition is not satisfied, the E_OUT_OF_RANGE exception is returned.
100 * @exception E_SUCCESS The method is successful.
101 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
103 result Construct(const Rectangle& rect);
106 * Initializes this instance of %Canvas with the specified parameter.
110 * @return An error code
111 * @param[in] rect The location and size of the canvas control on the device screen @n
112 * The width and height of the rectangle must be greater than @c 0.0f.
113 * If this condition is not satisfied, the E_OUT_OF_RANGE exception is returned.
114 * @exception E_SUCCESS The method is successful.
115 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
117 result Construct(const FloatRectangle& rect);
120 * Initializes this instance of %Canvas with the buffer information.
124 * @return An error code
125 * @param[in] bufferInfo The information of the buffer to be used by the canvas.
126 * @exception E_SUCCESS The method is successful.
127 * @exception E_INVALID_ARG The buffer information is invalid.
128 * @exception E_UNSUPPORTED_FORMAT The given buffer information is a format unsupported by the canvas.
129 * @exception E_SYSTEM An unknown operating system error has occurred
130 * @remarks Only PIXEL_FORMAT_ARGB8888 is supported.
132 result Construct(const BufferInfo& bufferInfo);
136 * Clears the current instance of %Canvas with the background color.
140 * @return An error code
141 * @exception E_SUCCESS The method is successful.
146 * Clears a rectangular region of the current instance of %Canvas with the background color.
150 * @return An error code
151 * @param[in] rect The location and size of the rectangular region @n
152 * The width and height of the rectangle must be greater than or equal to @c 0.
153 * The rectangular region must not fall outside the edges of the
154 * current instance of %Canvas entirely.If these conditions are not
155 * satisfied, the E_OUT_OF_RANGE exception is returned.
156 * @exception E_SUCCESS The method is successful.
157 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
159 result Clear(const Rectangle& rect);
162 * Clears a rectangular region of the current instance of %Canvas with the background color.
166 * @return An error code
167 * @param[in] rect The location and size of the rectangular region @n
168 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
169 * The rectangular region must not fall outside the edges of the
170 * current instance of %Canvas entirely.If these conditions are not
171 * satisfied, the E_OUT_OF_RANGE exception is returned.
172 * @exception E_SUCCESS The method is successful.
173 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
175 result Clear(const FloatRectangle& rect);
178 * Copies the specified rectangular region from the specified instance of %Canvas to the current instance of
179 * %Canvas at the specified location.
183 * @return An error code
184 * @param[in] destPoint The location to copy the rectangular region
185 * @param[in] srcCanvas The source %Canvas
186 * @param[in] srcRect The location and size of the rectangular region on the source %Canvas @n
187 * The rectangular region must not fall outside the edges of
188 * the current instance of %Canvas entirely. If this condition is
189 * not satisfied, the E_OUT_OF_RANGE exception is returned.
190 * @exception E_SUCCESS The method is successful.
191 * @exception E_INVALID_ARG A specified input parameter is invalid.
192 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
194 result Copy(const Point& destPoint, const Canvas& srcCanvas, const Rectangle& srcRect);
197 * Copies the specified rectangular region from the specified instance of %Canvas to the current instance of
198 * %Canvas at the specified location.
202 * @return An error code
203 * @param[in] destPoint The location to copy the rectangular region
204 * @param[in] srcCanvas The source %Canvas
205 * @param[in] srcRect The location and size of the rectangular region on the source %Canvas @n
206 * The rectangular region must not fall outside the edges of
207 * the current instance of %Canvas entirely. If this condition is
208 * not satisfied, the E_OUT_OF_RANGE exception is returned.
209 * @exception E_SUCCESS The method is successful.
210 * @exception E_INVALID_ARG A specified input parameter is invalid.
211 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
213 result Copy(const FloatPoint& destPoint, const Canvas& srcCanvas, const FloatRectangle& srcRect);
216 * Copies the scaled image of the specified rectangular region from the specified instance of
217 * %Canvas to the current instance of %Canvas.
221 * @return An error code
222 * @param[in] destRect The location and size of the destination image @n
223 * The value of @c destRect must not fall outside the edges of
224 * the current instance of %Canvas entirely. If this condition is
225 * not satisfied, the E_OUT_OF_RANGE exception is returned.
226 * @param[in] srcCanvas The source %Canvas
227 * @param[in] srcRect The location and size of the source image @n
228 * The value of @c srcRect must not fall outside the edges of
229 * the current instance of %Canvas entirely. If this condition is
230 * not satisfied, the E_OUT_OF_RANGE exception is returned.
231 * @exception E_SUCCESS The method is successful.
232 * @exception E_INVALID_ARG A specified input parameter is invalid.
233 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
234 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation.
236 result Copy(const Rectangle& destRect, const Canvas& srcCanvas, const Rectangle& srcRect);
239 * Copies the scaled image of the specified rectangular region from the specified instance of
240 * %Canvas to the current instance of %Canvas.
244 * @return An error code
245 * @param[in] destRect The location and size of the destination image @n
246 * The value of @c destRect must not fall outside the edges of
247 * the current instance of %Canvas entirely. If this condition is
248 * not satisfied, the E_OUT_OF_RANGE exception is returned.
249 * @param[in] srcCanvas The source %Canvas
250 * @param[in] srcRect The location and size of the source image @n
251 * The value of @c srcRect must not fall outside the edges of
252 * the current instance of %Canvas entirely. If this condition is
253 * not satisfied, the E_OUT_OF_RANGE exception is returned.
254 * @exception E_SUCCESS The method is successful.
255 * @exception E_INVALID_ARG A specified input parameter is invalid.
256 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
257 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation.
259 result Copy(const FloatRectangle& destRect, const Canvas& srcCanvas, const FloatRectangle& srcRect);
262 * Gets the line style set for the current instance of %Canvas.
266 * @return An instance of %LineStyle
267 * @remarks The default value is LINE_STYLE_SOLID.
269 LineStyle GetLineStyle(void) const;
272 * Gets the line width of the current instance of %Canvas.
276 * @return The line width, @n
277 * else @c -1 if the method fails
278 * @remarks The default value is 1.
280 int GetLineWidth(void) const;
283 * Gets the line width of the current instance of %Canvas.
287 * @return The line width, @n
288 * else @c -1.0f if the method fails
289 * @remarks The default value is 1.0f.
291 float GetLineWidthF(void) const;
294 * Sets the line style for the current instance of %Canvas.
298 * @return An error code
299 * @param[in] style The new line style for the %Canvas control
300 * @exception E_SUCCESS The method is successful.
301 * @exception E_INVALID_ARG The specified input parameter is invalid.
303 result SetLineStyle(LineStyle style);
306 * Sets the line width for the current instance of %Canvas.
310 * @return An error code
311 * @param[in] width The new width for the %Canvas control @n
312 * The width for the %Canvas control must be greater than @c 0.
313 * @exception E_SUCCESS The method is successful.
314 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
316 result SetLineWidth(int width);
319 * Sets the line width for the current instance of %Canvas.
323 * @return An error code
324 * @param[in] width The new width for the %Canvas control @n
325 * The width for the %Canvas control must be greater than @c 0.0f.
326 * @exception E_SUCCESS The method is successful.
327 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
329 result SetLineWidth(float width);
332 * Gets the dash pattern of the current instance of %Canvas.
336 * @return An error code
337 * @param[out] pattern The list containing the information of dash pattern.
338 * @param[out] offset The offset into the dash pattern at which the stroke must start
339 * @exception E_SUCCESS The method is successful.
340 * @exception E_INVALID_ARG A specific input parameter is invalid.
342 result GetDashPattern(Tizen::Base::Collection::IListT<int>& pattern, int& offset) const;
345 * Gets the dash pattern of the current instance of %Canvas.
349 * @return An error code
350 * @param[out] pattern The list containing the information of dash pattern.
351 * @param[out] offset The offset into the dash pattern at which the stroke must start
352 * @exception E_SUCCESS The method is successful.
353 * @exception E_INVALID_ARG A specific input parameter is invalid.
355 result GetDashPattern(Tizen::Base::Collection::IListT<float>& pattern, float& offset) const;
358 * Sets the dash pattern for the current instance of %Canvas.
362 * @return An error code
363 * @param[in] pattern The list containing the information of dash pattern.
364 * @param[in] offset The offset into the dash pattern at which the stroke must start
365 * @exception E_SUCCESS The method is successful.
366 * @exception E_INVALID_ARG A specific input parameter is invalid.
368 result SetDashPattern(const Tizen::Base::Collection::IListT<int>& pattern, int offset);
371 * Sets the dash pattern for the current instance of %Canvas.
375 * @return An error code
376 * @param[in] pattern The list containing the information of dash pattern.
377 * @param[in] offset The offset into the dash pattern at which the stroke must start
378 * @exception E_SUCCESS The method is successful.
379 * @exception E_INVALID_ARG A specific input parameter is invalid.
381 result SetDashPattern(const Tizen::Base::Collection::IListT<float>& pattern, float offset);
384 * Sets the line cap style.
388 * @return An error code
389 * @param[in] lineCapStyle The new line cap style
390 * @exception E_SUCCESS The method is successful.
391 * @exception E_INVALID_ARG The input parameter is invalid.
393 result SetLineCapStyle(LineCapStyle lineCapStyle);
396 * Gets the line cap style for the current instance.
400 * @return Current line cap style
401 * @remarks The default style is LINE_CAP_STYLE_ROUND.
403 LineCapStyle GetLineCapStyle(void) const;
406 * Sets the line join style.
410 * @return An error code
411 * @param[in] lineJoinStyle The new line join style.
412 * @exception E_SUCCESS The method is successful.
413 * @exception E_INVALID_ARG The input parameter is invalid.
415 result SetLineJoinStyle(LineJoinStyle lineJoinStyle);
418 * Gets the line join style for the current instance.
422 * @return Current line join style
423 * @remarks The default style is LINE_JOIN_STYLE_ROUND.
425 LineJoinStyle GetLineJoinStyle(void) const;
428 * Gets the color information at the specified point.
432 * @return An error code
433 * @param[in] point The location of the point relative to the upper-left corner of the current instance of %Canvas @n
434 * The point must not fall outside the edges of %Canvas. If this
435 * condition is not satisfied, the E_OUT_OF_RANGE exception is returned.
436 * @param[out] color An instance of Color
437 * @exception E_SUCCESS The method is successful.
438 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
440 result GetPixel(const Point& point, Color& color) const;
443 * Gets the color information at the specified point.
447 * @return An error code
448 * @param[in] point The location of the point relative to the upper-left corner of the current instance of %Canvas @n
449 * The point must not fall outside the edges of %Canvas. If this
450 * condition is not satisfied, the E_OUT_OF_RANGE exception is returned.
451 * @param[out] color An instance of Color
452 * @exception E_SUCCESS The method is successful.
453 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
455 result GetPixel(const FloatPoint& point, Color& color) const;
458 * Sets a point at the specified coordinate.
462 * @return An error code
463 * @param[in] point The location of the point relative to the upper-left corner of the current instance of %Canvas @n
464 * The point must not entirely fall outside the edges of %Canvas.
465 * If this condition is not satisfied, the E_OUT_OF_RANGE exception
467 * @exception E_SUCCESS The method is successful.
468 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
470 result SetPixel(const Point& point);
473 * Sets a point at the specified coordinate.
477 * @return An error code
478 * @param[in] point The location of the point relative to the upper-left corner of the current instance of %Canvas @n
479 * The point must not entirely fall outside the edges of %Canvas.
480 * If this condition is not satisfied, the E_OUT_OF_RANGE exception
482 * @exception E_SUCCESS The method is successful.
483 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
485 result SetPixel(const FloatPoint& point);
488 * Draws a line between the two specified points.
492 * @return An error code
493 * @param[in] point1 The starting point
494 * @param[in] point2 The end point
495 * @exception E_SUCCESS The method is successful.
497 result DrawLine(const Point& point1, const Point& point2);
500 * Draws a line between the two specified points.
504 * @return An error code
505 * @param[in] point1 The starting point
506 * @param[in] point2 The end point
507 * @exception E_SUCCESS The method is successful.
509 result DrawLine(const FloatPoint& point1, const FloatPoint& point2);
516 * @return An error code
517 * @param[in] rect The rectangle to be drawn on the %Canvas control @n
518 * The width and height of the rectangle must be greater than or equal to @c 0.
519 * The rectangle must not entirely fall outside the edges of
520 * the %Canvas control. If these conditions are not satisfied,
521 * the E_OUT_OF_RANGE exception is returned.
522 * @exception E_SUCCESS The method is successful.
523 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
525 result DrawRectangle(const Rectangle& rect);
532 * @return An error code
533 * @param[in] rect The rectangle to be drawn on the %Canvas control @n
534 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
535 * The rectangle must not entirely fall outside the edges of
536 * the %Canvas control. If these conditions are not satisfied,
537 * the E_OUT_OF_RANGE exception is returned.
538 * @exception E_SUCCESS The method is successful.
539 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
541 result DrawRectangle(const FloatRectangle& rect);
544 * Fills a rectangular region of the current instance of %Canvas with the specified color.
548 * @return An error code
549 * @param[in] color The fill color
550 * @param[in] rect The rectangular region on the %Canvas control @n
551 * The width and height of the rectangle must be greater than or equal to @c 0.
552 * The rectangle must not entirely fall outside the edges of the
553 * %Canvas control. If these conditions are not satisfied, the
554 * E_OUT_OF_RANGE exception is returned.
555 * @exception E_SUCCESS The method is successful.
556 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
558 result FillRectangle(const Color& color, const Rectangle& rect);
561 * Fills a rectangular region of the current instance of %Canvas with the specified color.
565 * @return An error code
566 * @param[in] color The fill color
567 * @param[in] rect The rectangular region on the %Canvas control @n
568 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
569 * The rectangle must not entirely fall outside the edges of the
570 * %Canvas control. If these conditions are not satisfied, the
571 * E_OUT_OF_RANGE exception is returned.
572 * @exception E_SUCCESS The method is successful.
573 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
575 result FillRectangle(const Color& color, const FloatRectangle& rect);
578 * Draws a round-edged rectangle.
582 * @return An error code
583 * @param[in] rect The location and size of the rectangle @n
584 * The width and height of the rectangle must be greater than or equal to @c 0.
585 * The rectangle must not entirely fall outside the edges of the
586 * %Canvas control. If these conditions are not satisfied, the
587 * E_OUT_OF_RANGE exception is returned.
588 * @param[in] arcDim The width and height of the round edge @n
589 * The width and height in the @c arcDim parameter must be greater than or equal to @c 0.
590 * @exception E_SUCCESS The method is successful.
591 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
593 result DrawRoundRectangle(const Rectangle& rect, const Dimension& arcDim);
596 * Draws a round-edged rectangle.
600 * @return An error code
601 * @param[in] rect The location and size of the rectangle @n
602 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
603 * The rectangle must not entirely fall outside the edges of the
604 * %Canvas control. If these conditions are not satisfied, the
605 * E_OUT_OF_RANGE exception is returned.
606 * @param[in] arcDim The width and height of the round edge @n
607 * The width and height in the @c arcDim parameter must be greater than or equal to @c 0.0f.
608 * @exception E_SUCCESS The method is successful.
609 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
611 result DrawRoundRectangle(const FloatRectangle& rect, const FloatDimension& arcDim);
614 * Draws a filled rectangle.
618 * @return An error code
619 * @param[in] color The fill color
620 * @param[in] rect The location and size of the rectangle @n
621 * The width and height of the rectangle must be greater than or equal to @c 0.
622 * The rectangle must not entirely fall outside the edges of the
623 * %Canvas control. If these conditions are not satisfied, the
624 * E_OUT_OF_RANGE exception is returned.
625 * @param[in] arcDim The width and height of the round edge @n
626 * The width and height mentioned in the @c arcDim parameter must be greater than or equal to @c 0.
627 * @exception E_SUCCESS The method is successful.
628 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
630 result FillRoundRectangle(const Color& color, const Rectangle& rect, const Dimension& arcDim);
633 * Draws a filled rectangle.
637 * @return An error code
638 * @param[in] color The fill color
639 * @param[in] rect The location and size of the rectangle @n
640 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
641 * The rectangle must not entirely fall outside the edges of the
642 * %Canvas control. If these conditions are not satisfied, the
643 * E_OUT_OF_RANGE exception is returned.
644 * @param[in] arcDim The width and height of the round edge @n
645 * The width and height mentioned in the @c arcDim parameter must be greater than or equal to @c 0.0f.
646 * @exception E_SUCCESS The method is successful.
647 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
649 result FillRoundRectangle(const Color& color, const FloatRectangle& rect, const FloatDimension& arcDim);
656 * @return An error code
657 * @param[in] rect The location and size of the bounding rectangle @n
658 * The width and height of the rectangle must be greater than or equal to @c 0.
659 * The rectangle must not entirely fall outside the edges of the
660 * %Canvas control. If these conditions are not satisfied, the
661 * E_OUT_OF_RANGE exception is returned.
662 * @exception E_SUCCESS The method is successful.
663 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
665 result DrawEllipse(const Rectangle& rect);
672 * @return An error code
673 * @param[in] rect The location and size of the bounding rectangle @n
674 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
675 * The rectangle must not entirely fall outside the edges of the
676 * %Canvas control. If these conditions are not satisfied, the
677 * E_OUT_OF_RANGE exception is returned.
678 * @exception E_SUCCESS The method is successful.
679 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
681 result DrawEllipse(const FloatRectangle& rect);
684 * Draws a filled ellipse with the specified color.
688 * @return An error code
689 * @param[in] color The fill color
690 * @param[in] rect The location and size of the bounding rectangle @n
691 * The width and height of the rectangle must be greater than or equal to @c 0. @n
692 * The rectangle must not entirely fall outside the edges of the
693 * %Canvas control. If these conditions are not satisfied, the
694 * E_OUT_OF_RANGE exception is returned.
695 * @exception E_SUCCESS The method is successful.
696 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
698 result FillEllipse(const Color& color, const Rectangle& rect);
701 * Draws a filled ellipse with the specified color.
705 * @return An error code
706 * @param[in] color The fill color
707 * @param[in] rect The location and size of the bounding rectangle @n
708 * The width and height of the rectangle must be greater than or equal to @c 0.0f. @n
709 * The rectangle must not entirely fall outside the edges of the
710 * %Canvas control. If these conditions are not satisfied, the
711 * E_OUT_OF_RANGE exception is returned.
712 * @exception E_SUCCESS The method is successful.
713 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
715 result FillEllipse(const Color& color, const FloatRectangle& rect);
718 * Draws a circular arc.
722 * @return An error code
723 * @param[in] rect The location and size of the bounding rectangle @n
724 * The width and height of the rectangle must be greater than or equal to @c 0.
725 * The rectangle must not entirely fall outside the edges of the
726 * %Canvas control. If these conditions are not satisfied, the
727 * E_OUT_OF_RANGE exception is returned.
728 * @param[in] startAngle The starting angle
729 * @param[in] endAngle The ending angle
730 * @param[in] arcStyle The arc style
731 * @exception E_SUCCESS The method is successful.
732 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
733 * @exception E_INVALID_ARG A specified input parameter is invalid.
735 result DrawArc(const Rectangle& rect, int startAngle, int endAngle, ArcStyle arcStyle);
738 * Draws a circular arc.
742 * @return An error code
743 * @param[in] rect The location and size of the bounding rectangle @n
744 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
745 * The rectangle must not entirely fall outside the edges of the
746 * %Canvas control. If these conditions are not satisfied, the
747 * E_OUT_OF_RANGE exception is returned.
748 * @param[in] startAngle The starting angle
749 * @param[in] endAngle The ending angle
750 * @param[in] arcStyle The arc style
751 * @exception E_SUCCESS The method is successful.
752 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
753 * @exception E_INVALID_ARG A specified input parameter is invalid.
755 result DrawArc(const FloatRectangle& rect, float startAngle, float endAngle, ArcStyle arcStyle);
762 * @return An error code
763 * @param[in] point1 The location of the first vertex
764 * @param[in] point2 The location of the second vertex
765 * @param[in] point3 The location of the third vertex
766 * @exception E_SUCCESS The method is successful.
768 result DrawTriangle(const Point& point1, const Point& point2, const Point& point3);
775 * @return An error code
776 * @param[in] point1 The location of the first vertex
777 * @param[in] point2 The location of the second vertex
778 * @param[in] point3 The location of the third vertex
779 * @exception E_SUCCESS The method is successful.
781 result DrawTriangle(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& point3);
784 * Draw a filled triangle with the specified color.
788 * @return An error code
789 * @param[in] color The fill color
790 * @param[in] point1 The location of the first vertex
791 * @param[in] point2 The location of the second vertex
792 * @param[in] point3 The location of the third vertex
793 * @exception E_SUCCESS The method is successful.
795 result FillTriangle(const Color& color, const Point& point1, const Point& point2, const Point& point3);
798 * Draw a filled triangle with the specified color.
802 * @return An error code
803 * @param[in] color The fill color
804 * @param[in] point1 The location of the first vertex
805 * @param[in] point2 The location of the second vertex
806 * @param[in] point3 The location of the third vertex
807 * @exception E_SUCCESS The method is successful.
809 result FillTriangle(const Color& color, const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& point3);
816 * @return An error code
817 * @param[in] points A list containing the location of points @n
818 * The number of points must be greater than or equal to @c 0.
819 * @exception E_SUCCESS The method is successful.
820 * @exception E_INVALID_ARG The specified input parameter is invalid.
822 result DrawPolyline(const Tizen::Base::Collection::IList& points);
829 * @return An error code
830 * @param[in] points A list containing the locations of the vertices of the polygon @n
831 * The number of points must be greater than or equal to @c 0.
832 * @exception E_SUCCESS The method is successful.
833 * @exception E_INVALID_ARG The specified input parameter is invalid.
835 result DrawPolygon(const Tizen::Base::Collection::IList& points);
838 * Draws a filled polygon with the specified color.
842 * @return An error code
843 * @param[in] color The fill color
844 * @param[in] points A list containing the locations of the vertices of the polygon @n
845 * The number of points must be greater than or equal to @c 0.
846 * @exception E_SUCCESS The method is successful.
847 * @exception E_INVALID_ARG A specified input parameter is invalid.
849 result FillPolygon(const Color& color, const Tizen::Base::Collection::IList& points);
852 * Sets a font to the %Canvas control.
856 * @return An error code
857 * @param[in] font The font @n
858 * It must be constructed before being passed to this method.
859 * @exception E_SUCCESS The method is successful.
860 * @exception E_INVALID_ARG The specified input parameter is invalid.
862 result SetFont(const Font& font);
865 * Gets a font of the %Canvas control.
869 * @return The font of the %Canvas control, @n
870 * else @c null if the method fails
871 * @exception E_SUCCESS The method is successful.
872 * @exception E_OUT_OF_MEMORY The memory is insufficient.
873 * @remarks The specific error code can be accessed using the GetLastResult() method.
874 * @remarks If a font is not set with the SetFont() method, this method returns the system default font.
876 Font* GetFontN(void) const;
879 * Draws a text at the specified location.
883 * @return An error code
884 * @param[in] point The location to draw the text
885 * @param[in] text The text to draw
886 * @exception E_SUCCESS The method is successful.
887 * @exception E_INVALID_ARG A specified input parameter is invalid.
888 * @exception E_OPERATION_FAILED The operation has failed.
889 * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color.
890 * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn.
892 result DrawText(const Point& point, const Tizen::Base::String& text);
895 * Draws a text at the specified location.
899 * @return An error code
900 * @param[in] point The location to draw the text
901 * @param[in] text The text to draw
902 * @exception E_SUCCESS The method is successful.
903 * @exception E_INVALID_ARG A specified input parameter is invalid.
904 * @exception E_OPERATION_FAILED The operation has failed.
905 * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color.
906 * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn.
908 result DrawText(const FloatPoint& point, const Tizen::Base::String& text);
911 * Draws a text at the specified location and length.
915 * @return An error code
916 * @param[in] point The location to draw the text
917 * @param[in] text The text to draw
918 * @param[in] length The number of characters in the string @n
919 * It must be greater than or equal to @c 0.
920 * @exception E_SUCCESS The method is successful.
921 * @exception E_INVALID_ARG A specified input parameter is invalid.
922 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
923 * @exception E_OPERATION_FAILED The operation has failed.
924 * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color.
925 * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn.
927 result DrawText(const Point& point, const Tizen::Base::String& text, int length);
930 * Draws a text at the specified location and length.
934 * @return An error code
935 * @param[in] point The location to draw the text
936 * @param[in] text The text to draw
937 * @param[in] length The number of characters in the string @n
938 * It must be greater than or equal to @c 0.
939 * @exception E_SUCCESS The method is successful.
940 * @exception E_INVALID_ARG A specified input parameter is invalid.
941 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
942 * @exception E_OPERATION_FAILED The operation has failed.
943 * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color.
944 * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn.
946 result DrawText(const FloatPoint& point, const Tizen::Base::String& text, int length);
949 * Draws a text with an outline rendering at the specified location.
953 * @return An error code
954 * @param[in] point The location to draw the text
955 * @param[in] text The text to draw @n
956 * @param[in] outlineColor The color that is set as outline color
957 * @exception E_SUCCESS The method is successful.
958 * @exception E_INVALID_ARG A specified input parameter is invalid.
959 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
960 * @exception E_OPERATION_FAILED The operation has failed.
961 * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color.
962 * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn.
964 result DrawText(const Point& point, const Tizen::Base::String& text, const Color& outlineColor);
967 * Draws a text with an outline rendering at the specified location.
971 * @return An error code
972 * @param[in] point The location to draw the text
973 * @param[in] text The text to draw @n
974 * @param[in] outlineColor The color that is set as outline color
975 * @exception E_SUCCESS The method is successful.
976 * @exception E_INVALID_ARG A specified input parameter is invalid.
977 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
978 * @exception E_OPERATION_FAILED The operation has failed.
979 * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color.
980 * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn.
982 result DrawText(const FloatPoint& point, const Tizen::Base::String& text, const Color& outlineColor);
985 * Draws a text with an outline rendering at the specified location and length.
989 * @return An error code
990 * @param[in] point The location to draw the text
991 * @param[in] text The text to draw
992 * @param[in] length The number of characters in the string @n
993 * It must be greater than or equal to @c 0.
994 * @param[in] outlineColor The color that is set as outline color
995 * @exception E_SUCCESS The method is successful.
996 * @exception E_INVALID_ARG A specified input parameter is invalid.
997 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
998 * @exception E_OPERATION_FAILED The operation has failed.
1000 * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color.
1001 * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn.
1003 result DrawText(const Point& point, const Tizen::Base::String& text, int length, const Color& outlineColor);
1006 * Draws a text with an outline rendering at the specified location and length.
1010 * @return An error code
1011 * @param[in] point The location to draw the text
1012 * @param[in] text The text to draw
1013 * @param[in] length The number of characters in the string @n
1014 * It must be greater than or equal to @c 0.
1015 * @param[in] outlineColor The color that is set as outline color
1016 * @exception E_SUCCESS The method is successful.
1017 * @exception E_INVALID_ARG A specified input parameter is invalid.
1018 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1019 * @exception E_OPERATION_FAILED The operation has failed.
1021 * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color.
1022 * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn.
1024 result DrawText(const FloatPoint& point, const Tizen::Base::String& text, int length, const Color& outlineColor);
1027 * Draws an enriched text at the specified area.
1031 * @return An error code
1032 * @param[in] point The location to draw the text
1033 * @param[in] enrichedText The TextElement to draw
1034 * @exception E_SUCCESS The method is successful.
1035 * @exception E_DEVICE_UNAVAILABLE A specified device is invalid.
1037 * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color.
1038 * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn.
1040 result DrawText(const Point& point, const EnrichedText& enrichedText);
1043 * Draws an enriched text at the specified area.
1047 * @return An error code
1048 * @param[in] point The location to draw the text
1049 * @param[in] enrichedText The TextElement to draw
1050 * @exception E_SUCCESS The method is successful.
1051 * @exception E_DEVICE_UNAVAILABLE A specified device is invalid.
1053 * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color.
1054 * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn.
1056 result DrawText(const FloatPoint& point, const EnrichedText& enrichedText);
1059 * Draws a bitmap image at the specified location.
1063 * @return An error code
1064 * @param[in] point The location of the upper-left corner of the bitmap
1065 * @param[in] bitmap The bitmap to draw @n
1066 * It must be constructed before being passed into this
1067 * method. BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is
1068 * not applicable for this method. The bitmap must not
1069 * entirely fall outside the edges of the %Canvas control. If
1070 * this condition is not satisfied, the E_OUT_OF_RANGE exception
1072 * @exception E_SUCCESS The method is successful.
1073 * @exception E_INVALID_ARG A specified input parameter is invalid.
1075 result DrawBitmap(const Point& point, const Bitmap& bitmap);
1078 * Draws a bitmap image at the specified location.
1082 * @return An error code
1083 * @param[in] point The location of the upper-left corner of the bitmap
1084 * @param[in] bitmap The bitmap to draw @n
1085 * It must be constructed before being passed into this
1086 * method. BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is
1087 * not applicable for this method. The bitmap must not
1088 * entirely fall outside the edges of the %Canvas control. If
1089 * this condition is not satisfied, the E_OUT_OF_RANGE exception
1091 * @exception E_SUCCESS The method is successful.
1092 * @exception E_INVALID_ARG A specified input parameter is invalid.
1094 result DrawBitmap(const FloatPoint& point, const Bitmap& bitmap);
1097 * Draws a bitmap image at the specified location.
1101 * @return An error code
1102 * @param[in] rect The location and size of the scaled bitmap @n
1103 * The rectangle must not entirely fall outside the edges of the
1104 * %Canvas control. If this condition is not satisfied, the
1105 * E_OUT_OF_RANGE exception is returned.
1106 * @param[in] bitmap The bitmap to draw @n
1107 * It must be constructed well before being passed into this
1109 * @exception E_SUCCESS The method is successful.
1110 * @exception E_INVALID_ARG A specified input parameter is invalid.
1111 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1112 * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1114 result DrawBitmap(const Rectangle& rect, const Bitmap& bitmap);
1117 * Draws a bitmap image at the specified location.
1121 * @return An error code
1122 * @param[in] rect The location and size of the scaled bitmap @n
1123 * The rectangle must not entirely fall outside the edges of the
1124 * %Canvas control. If this condition is not satisfied, the
1125 * E_OUT_OF_RANGE exception is returned.
1126 * @param[in] bitmap The bitmap to draw @n
1127 * It must be constructed well before being passed into this
1129 * @exception E_SUCCESS The method is successful.
1130 * @exception E_INVALID_ARG A specified input parameter is invalid.
1131 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1132 * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1134 result DrawBitmap(const FloatRectangle& rect, const Bitmap& bitmap);
1137 * Draws a color data corresponding to a rectangle of pixels from the specified bitmap onto %Canvas.
1141 * @return An error code
1142 * @param[in] destRect The destination rectangle of %Canvas @n
1143 * The width and height of the rectangle must be greater than or equal to @c 0.
1144 * The rectangle defined by @c destRect will be clipped at the edges
1145 * of the %Canvas control to prevent the rectangle from falling
1146 * outside the edges of the %Canvas control. The destination
1147 * rectangle of a %Canvas control must not fall outside the edges
1148 * of the %Canvas control entirely. If these conditions are not
1149 * satisfied, the E_OUT_OF_RANGE exception is returned.
1150 * @param[in] srcBitmap The bitmap to draw
1151 * @param[in] srcRect The source rectangle of a bitmap @n
1152 * The width and height of the rectangle must be greater than or equal to @c 0.
1153 * The rectangle defined by @c srcRect will be clipped at the edges
1154 * of the bitmap to prevent the rectangle from falling outside the
1155 * edges of the bitmap. The source rectangle of a bitmap must not
1156 * fall outside the edges of the bitmap entirely. If these
1157 * conditions are not satisfied, the E_OUT_OF_RANGE exception is
1159 * @exception E_SUCCESS The method is successful.
1160 * @exception E_INVALID_ARG A specified input parameter is invalid.
1161 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1162 * @remarks If the source and destination rectangles are not of the same size,
1163 * the source bitmap is stretched to match the destination rectangle. @n
1164 * BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1166 result DrawBitmap(const Rectangle& destRect, const Bitmap& srcBitmap, const Rectangle& srcRect);
1169 * Draws a color data corresponding to a rectangle of pixels from the specified bitmap onto %Canvas.
1173 * @return An error code
1174 * @param[in] destRect The destination rectangle of %Canvas @n
1175 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
1176 * The rectangle defined by @c destRect will be clipped at the edges
1177 * of the %Canvas control to prevent the rectangle from falling
1178 * outside the edges of the %Canvas control. The destination
1179 * rectangle of a %Canvas control must not fall outside the edges
1180 * of the %Canvas control entirely. If these conditions are not
1181 * satisfied, the E_OUT_OF_RANGE exception is returned.
1182 * @param[in] srcBitmap The bitmap to draw
1183 * @param[in] srcRect The source rectangle of a bitmap @n
1184 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
1185 * The rectangle defined by @c srcRect will be clipped at the edges
1186 * of the bitmap to prevent the rectangle from falling outside the
1187 * edges of the bitmap. The source rectangle of a bitmap must not
1188 * fall outside the edges of the bitmap entirely. If these
1189 * conditions are not satisfied, the E_OUT_OF_RANGE exception is
1191 * @exception E_SUCCESS The method is successful.
1192 * @exception E_INVALID_ARG A specified input parameter is invalid.
1193 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1194 * @remarks If the source and destination rectangles are not of the same size,
1195 * the source bitmap is stretched to match the destination rectangle. @n
1196 * BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1198 result DrawBitmap(const FloatRectangle& destRect, const Bitmap& srcBitmap, const FloatRectangle& srcRect);
1201 * Draws a flipped bitmap image at the specified location.
1205 * @return An error code
1206 * @param[in] point The location to draw the bitmap
1207 * @param[in] bitmap The bitmap to draw @n
1208 * It must be constructed before being passed to this method.
1209 * @param[in] dir The flip direction
1210 * @exception E_SUCCESS The method is successful.
1211 * @exception E_INVALID_ARG A specified input parameter is invalid.
1212 * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1214 result DrawBitmap(const Point& point, const Bitmap& bitmap, FlipDirection dir);
1217 * Draws a flipped bitmap image at the specified location.
1221 * @return An error code
1222 * @param[in] point The location to draw the bitmap
1223 * @param[in] bitmap The bitmap to draw @n
1224 * It must be constructed before being passed to this method.
1225 * @param[in] dir The flip direction
1226 * @exception E_SUCCESS The method is successful.
1227 * @exception E_INVALID_ARG A specified input parameter is invalid.
1228 * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1230 result DrawBitmap(const FloatPoint& point, const Bitmap& bitmap, FlipDirection dir);
1233 * Draws a rotated bitmap image at the specified location.
1237 * @return An error code
1238 * @param[in] point A location to draw a bitmap image @n
1239 * This location is relatively defined from the origin (upper-left
1240 * corner) of the %Canvas control.
1241 * @param[in] bitmap The bitmap to draw @n
1242 * It must be constructed before being passed to this method.
1243 * @param[in] pivot The center of rotation of a bitmap image @n
1244 * This center is relatively defined from the origin (upper-left
1245 * corner) of the bitmap.
1246 * @param[in] degree The amount of rotation in degrees
1247 * @exception E_SUCCESS The method is successful.
1248 * @exception E_INVALID_ARG A specified input parameter is invalid.
1249 * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1250 * @image html graphics_rotatebitmap.PNG
1252 result DrawBitmap(const Point& point, const Bitmap& bitmap, const Point& pivot, int degree);
1255 * Draws a rotated bitmap image at the specified location.
1259 * @return An error code
1260 * @param[in] point A location to draw a bitmap image @n
1261 * This location is relatively defined from the origin (upper-left
1262 * corner) of the %Canvas control.
1263 * @param[in] bitmap The bitmap to draw @n
1264 * It must be constructed before being passed to this method.
1265 * @param[in] pivot The center of rotation of a bitmap image @n
1266 * This center is relatively defined from the origin (upper-left
1267 * corner) of the bitmap.
1268 * @param[in] degree The amount of rotation in degrees
1269 * @exception E_SUCCESS The method is successful.
1270 * @exception E_INVALID_ARG A specified input parameter is invalid.
1271 * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1272 * @image html graphics_rotatebitmap.PNG
1274 result DrawBitmap(const FloatPoint& point, const Bitmap& bitmap, const FloatPoint& pivot, float degree);
1277 * Draws a nine-patched bitmap at the specified location.
1281 * @return An error code
1282 * @param[in] rect The location and size of the nine-patched bitmap @n
1283 * The rectangle must not entirely fall outside the edges of the
1284 * %Canvas control. If this condition is not satisfied, the
1285 * E_OUT_OF_RANGE exception is returned.
1286 * @param[in] bitmap The bitmap to draw @n
1287 * It must be constructed before being passed to this method.
1288 * @exception E_SUCCESS The method is successful.
1289 * @exception E_INVALID_ARG A specified input parameter is invalid.
1290 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1292 * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method. @n
1293 * The nine-patched bitmap must have a stretchable section by drawing one (or more) 1-pixel-wide black line(s) in the
1294 * left and top part of the border.
1295 * @image html graphics_ninepatchedbitmap.PNG
1298 result DrawNinePatchedBitmap(const Rectangle& rect, const Bitmap& bitmap);
1301 * Draws a nine-patched bitmap at the specified location.
1305 * @return An error code
1306 * @param[in] rect The location and size of the nine-patched bitmap @n
1307 * The rectangle must not entirely fall outside the edges of the
1308 * %Canvas control. If this condition is not satisfied, the
1309 * E_OUT_OF_RANGE exception is returned.
1310 * @param[in] bitmap The bitmap to draw @n
1311 * It must be constructed before being passed to this method.
1312 * @exception E_SUCCESS The method is successful.
1313 * @exception E_INVALID_ARG A specified input parameter is invalid.
1314 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1316 * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method. @n
1317 * The nine-patched bitmap must have a stretchable section by drawing one (or more) 1-pixel-wide black line(s) in the
1318 * left and top part of the border.
1319 * @image html graphics_ninepatchedbitmap.PNG
1322 result DrawNinePatchedBitmap(const FloatRectangle& rect, const Bitmap& bitmap);
1325 * Shows the current instance of %Canvas on the device screen.
1328 * @brief <i> [Compatibility] </i>
1332 * @compatibility This method has compatibility issues with OSP compatible applications @n
1333 * For more information, see the issue description for @ref CompCanvasShowPage "here".
1336 * @return An error code
1337 * @exception E_SUCCESS The method is successful.
1338 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
1345 * @page CompCanvasShowPage Compatibility for Show().
1346 * @section CompCanvasShowPageIssueSection Issues
1347 * In Tizen, memory canvas is not fully supported, and we cannot guarantee that Show() for memory canvas of Tizen does the same operation with that of OSP.
1349 * -# In OSP, when Show() is called for a Memory Canvas, the canvas was copied to the screen and E_SUCCESS was returned, but the canvas is not guaranteed to be displayed properly.
1350 * -# In Tizen, Show() does not function for a Memory Canvas, so E_UNSUPPORTED_OPERATION is returned. Memory Canvases cannot be used to directly show its content on screen.
1358 * Shows the specified rectangle of the current instance of %Canvas on the device screen.
1360 * @brief <i> [Deprecated] </i>
1361 * @deprecated This method is deprecated. Instead of this method, use the Show().
1364 * @return An error code
1365 * @param[in] rect The bounds of the %Canvas control to display @n
1366 * The width and height of the rectangle must be greater than or equal to @c 0.
1367 * The rectangle must not entirely fall outside the edges of the
1368 * %Canvas control. If these conditions are not satisfied, the
1369 * E_OUT_OF_RANGE exception is returned.
1370 * @exception E_SUCCESS The method is successful.
1371 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1373 * @remark If you use Show(Rectangle&) in Tizen, this method works differently. @n
1374 * This method shows the screen entirely not partially in Tizen.
1377 result Show(const Rectangle& rect);
1380 * Gets the location and size of the current %Canvas instance on the device screen.
1384 * @return The Rectangle instance containing the location and size of the current %Canvas instance
1385 * @remarks If this %Canvas instance is a Window %Canvas, it returns Rectangle(0, 0, w, h).
1387 Rectangle GetBounds(void) const;
1390 * Gets the location and size of the current %Canvas instance on the device screen.
1394 * @return The Rectangle instance containing the location and size of the current %Canvas instance
1395 * @remarks If this %Canvas instance is a Window %Canvas, it returns FloatRectangle(0.0f, 0.0f, w, h).
1397 FloatRectangle GetBoundsF(void) const;
1400 * Gets the actual location and size of the current %Canvas instance on the device screen.
1404 * @return The Rectangle instance containing the actual location and size of the current %Canvas instance
1405 * @remarks If this %Canvas instance is a Window %Canvas, it returns FloatRectangle(0.0f, 0.0f, w, h).
1407 FloatRectangle GetActualBounds(void) const;
1410 * Sets the clip rectangle for a %Canvas control. @n
1411 * When a clip rectangle is set, any drawing is restricted within the specified rectangular area. The
1412 * rectangular area defined is clipped at the edges of the %Canvas control so as to prevent the clipped rectangle
1413 * from falling outside the %Canvas control.
1417 * @return An error code
1418 * @param[in] rect The bounds of the clip rectangle @n
1419 * The width and height of the rectangle must be greater than or equal to @c 0.
1420 * The clip rectangle for a %Canvas control must not entirely fall
1421 * outside the edges of the %Canvas control. If these conditions are
1422 * not satisfied, the E_OUT_OF_RANGE exception is returned.
1423 * @exception E_SUCCESS The method is successful.
1424 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1426 result SetClipBounds(const Rectangle& rect);
1429 * Sets the clip rectangle for a %Canvas control. @n
1430 * When a clip rectangle is set, any drawing is restricted within the specified rectangular area. The
1431 * rectangular area defined is clipped at the edges of the %Canvas control so as to prevent the clipped rectangle
1432 * from falling outside the %Canvas control.
1436 * @return An error code
1437 * @param[in] rect The bounds of the clip rectangle @n
1438 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
1439 * The clip rectangle for a %Canvas control must not entirely fall
1440 * outside the edges of the %Canvas control. If these conditions are
1441 * not satisfied, the E_OUT_OF_RANGE exception is returned.
1442 * @exception E_SUCCESS The method is successful.
1443 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1445 result SetClipBounds(const FloatRectangle& rect);
1448 * Gets the bounds of the clip rectangle of a %Canvas control.
1452 * @return An instance of Rectangle indicating the bounds of the clip rectangle
1454 Rectangle GetClipBounds(void) const;
1457 * Gets the bounds of the clip rectangle of a %Canvas control.
1461 * @return An instance of Rectangle indicating the bounds of the clip rectangle
1463 FloatRectangle GetClipBoundsF(void) const;
1466 * Locks the %Canvas control for direct pixel access. @n
1467 * This sets up a %Canvas control for accessing the pixels directly. Between the calls to the
1468 * Canvas::Lock() and Canvas::UnLock() methods, the data can be written to and read from the
1469 * Canvas control's pixels. Once the operations on the %Canvas control's pixels are finished, the
1470 * Canvas::Unlock() method must be called to release the lock.
1474 * @return An error code
1475 * @param[out] info The information of the %Canvas control
1476 * @param[in] timeout The time, in milliseconds, that the caller waits for the lock to be obtained @n
1477 * If the lock attempt fails, E_TIMEOUT is returned. The default value
1478 * is INFINITE, which means that the method does not return until the lock
1480 * @exception E_SUCCESS The method is successful.
1481 * @exception E_TIMEOUT The operation cannot be completed within the specified time period.
1482 * @exception E_SYSTEM An unknown operating system error has occurred.
1484 * @remarks BufferInfo contains a valid physical memory information, regardless of the
1485 * logical position and size of the %Canvas control.
1487 result Lock(BufferInfo& info, long timeout = INFINITE);
1490 * Unlocks the %Canvas control.
1494 * @return An error code
1495 * @exception E_SUCCESS The method is successful.
1496 * @exception E_SYSTEM An unknown operating system error has occurred.
1497 * @remarks The %Canvas control must be unlocked as soon as possible.
1499 result Unlock(void);
1502 * Sets the foreground color.
1506 * @param[in] color The color that is set as foreground color
1508 void SetForegroundColor(const Color& color);
1511 * Gets the foreground color.
1515 * @return The foreground color
1517 Color GetForegroundColor(void) const;
1520 * Sets the background color.
1524 * @param[in] color The color that is set as background color
1526 void SetBackgroundColor(const Color& color);
1529 * Gets the background color.
1533 * @return The background color
1535 Color GetBackgroundColor(void) const;
1538 * Sets the current instance of %Canvas to the specified point.
1540 * @brief <i> [Deprecated] </i>
1541 * @deprecated This method is deprecated.
1544 * @return An error code
1545 * @param[in] point The new position
1546 * @exception E_SUCCESS The method is successful.
1547 * @exception E_UNSUPPORTED_OPERATION Window %Canvas does not support moving the position.
1549 * @remarks Canvas::SetPosition(const Point& point) is not supported anymore since Tizen2.1. @n
1550 * This function has influence on only Memory canvas. However, Memory Canvas Show() is deprecated in Tizen2.0, and this method has no meaning since Tizen2.0 and deprecated since Tizen2.1.
1552 result SetPosition(const Point& point);
1555 * Sets the current instance of %Canvas to the specified point.
1557 * @brief <i> [Deprecated] </i>
1558 * @deprecated This method is deprecated.
1561 * @return An error code
1562 * @param[in] x The new x-coordinate
1563 * @param[in] y The new y-coordinate
1564 * @exception E_SUCCESS The method is successful.
1565 * @exception E_UNSUPPORTED_OPERATION Window %Canvas does not support moving the position.
1567 * @remarks Canvas::SetPosition(int x, int y) is not supported anymore since Tizen2.1. @n
1568 * This function has influence on only Memory canvas. However, Memory Canvas Show() is deprecated in Tizen2.0, and this method has no meaning since Tizen2.0 and deprecated since Tizen2.1.
1570 result SetPosition(int x, int y);
1573 * Sets the composite mode.
1577 * @return An error code
1578 * @param[in] compositeMode The new composite mode
1579 * @exception E_SUCCESS The method is successful.
1580 * @exception E_INVALID_ARG The input parameter is invalid.
1582 result SetCompositeMode(CompositeMode compositeMode);
1585 * Gets the composite mode for the current instance.
1589 * @return Current composite mode
1590 * @remarks The default value is COMPOSITE_MODE_SRC_OVER.
1592 CompositeMode GetCompositeMode(void) const;
1597 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
1599 Canvas(const Canvas& rhs);
1602 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
1604 Canvas& operator =(const Canvas& rhs);
1606 friend class Bitmap;
1607 friend class TextElement;
1610 friend class _CanvasImpl;
1613 // This variable is for internal use only.
1614 // Using this variable can cause behavioral, security-related, and consistency-related issues in the application.
1618 class _CanvasImpl* __pImpl;
1622 }} // Tizen::Graphics
1624 #endif //_FGRP_CANVAS_H_