2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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 @c 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 a 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 @c 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 use 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 @c 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 @c 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 @c 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 a specified rectangular region from a specified instance of %Canvas to the current instance of
198 * %Canvas at a 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 @c 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 @c 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 @c 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 a specified rectangular region from a 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 @c 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 @c 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 @c 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 @c 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 @c 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 specified input parameter is invalid.
393 result SetLineCapStyle(LineCapStyle lineCapStyle);
396 * Gets the line cap style for the current instance.
400 * @return The current line cap style
401 * @remarks The default style is @c 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 specified input parameter is invalid.
415 result SetLineJoinStyle(LineJoinStyle lineJoinStyle);
418 * Gets the line join style for the current instance.
422 * @return The current line join style
423 * @remarks The default style is @c 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 @c 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 a 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 @c 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 @c 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 a 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 @c 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 draw 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 @c 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 that is 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 @c 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 * @c 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 a 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 * @c 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 * @c 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 * @c 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 * @c 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 * @c 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 * @c 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 * @c 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 * @c 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 a 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 * @c 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 * @c 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 * @c 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 a 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.
874 * - The specific error code can be accessed using the GetLastResult() method.
875 * - If a font is not set with the SetFont() method, this method returns the system default font.
877 Font* GetFontN(void) const;
880 * Draws a text at the specified location.
884 * @return An error code
885 * @param[in] point The location to draw the text
886 * @param[in] text The text to draw
887 * @exception E_SUCCESS The method is successful.
888 * @exception E_INVALID_ARG A specified input parameter is invalid.
889 * @exception E_OPERATION_FAILED The operation has failed.
891 * - The foreground color (RGB value only) of the %Canvas control is used as the text color.
892 * - 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.
894 result DrawText(const Point& point, const Tizen::Base::String& text);
897 * Draws a text at a specified location.
901 * @return An error code
902 * @param[in] point The location to draw the text
903 * @param[in] text The text to draw
904 * @exception E_SUCCESS The method is successful.
905 * @exception E_INVALID_ARG A specified input parameter is invalid.
906 * @exception E_OPERATION_FAILED The operation has failed.
908 * - The foreground color (RGB value only) of the %Canvas control is used as the text color.
909 * - 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.
911 result DrawText(const FloatPoint& point, const Tizen::Base::String& text);
914 * Draws a text at the specified location and length.
918 * @return An error code
919 * @param[in] point The location to draw the text
920 * @param[in] text The text to draw
921 * @param[in] length The number of characters in the string @n
922 * It must be greater than or equal to @c 0.
923 * @exception E_SUCCESS The method is successful.
924 * @exception E_INVALID_ARG A specified input parameter is invalid.
925 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
926 * @exception E_OPERATION_FAILED The operation has failed.
928 * - The foreground color (RGB value only) of the %Canvas control is used as the text color.
929 * - 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.
931 result DrawText(const Point& point, const Tizen::Base::String& text, int length);
934 * Draws a text at a specified location and length.
938 * @return An error code
939 * @param[in] point The location to draw the text
940 * @param[in] text The text to draw
941 * @param[in] length The number of characters in the string @n
942 * It must be greater than or equal to @c 0.
943 * @exception E_SUCCESS The method is successful.
944 * @exception E_INVALID_ARG A specified input parameter is invalid.
945 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
946 * @exception E_OPERATION_FAILED The operation has failed.
948 * - The foreground color (RGB value only) of the %Canvas control is used as the text color.
949 * - 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.
951 result DrawText(const FloatPoint& point, const Tizen::Base::String& text, int length);
954 * Draws a text with an outline rendering at the specified location.
958 * @return An error code
959 * @param[in] point The location to draw the text
960 * @param[in] text The text to draw @n
961 * @param[in] outlineColor The color that is set as outline color
962 * @exception E_SUCCESS The method is successful.
963 * @exception E_INVALID_ARG A specified input parameter is invalid.
964 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
965 * @exception E_OPERATION_FAILED The operation has failed.
967 * - The foreground color (RGB value only) of the %Canvas control is used as the text color.
968 * - 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.
970 result DrawText(const Point& point, const Tizen::Base::String& text, const Color& outlineColor);
973 * Draws a text with an outline rendering at a specified location.
977 * @return An error code
978 * @param[in] point The location to draw the text
979 * @param[in] text The text to draw
980 * @param[in] outlineColor The color that is set as outline color
981 * @exception E_SUCCESS The method is successful.
982 * @exception E_INVALID_ARG A specified input parameter is invalid.
983 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
984 * @exception E_OPERATION_FAILED The operation has failed.
986 * - The foreground color (RGB value only) of the %Canvas control is used as the text color.
987 * - 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.
989 result DrawText(const FloatPoint& point, const Tizen::Base::String& text, const Color& outlineColor);
992 * Draws a text with an outline rendering at the specified location and length.
996 * @return An error code
997 * @param[in] point The location to draw the text
998 * @param[in] text The text to draw
999 * @param[in] length The number of characters in the string @n
1000 * It must be greater than or equal to @c 0.
1001 * @param[in] outlineColor The color that is set as outline color
1002 * @exception E_SUCCESS The method is successful.
1003 * @exception E_INVALID_ARG A specified input parameter is invalid.
1004 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1005 * @exception E_OPERATION_FAILED The operation has failed.
1007 * - The foreground color (RGB value only) of the %Canvas control is used as the text color.
1008 * - 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.
1010 result DrawText(const Point& point, const Tizen::Base::String& text, int length, const Color& outlineColor);
1013 * Draws a text with an outline rendering at a specified location and length.
1017 * @return An error code
1018 * @param[in] point The location to draw the text
1019 * @param[in] text The text to draw
1020 * @param[in] length The number of characters in the string @n
1021 * It must be greater than or equal to @c 0.
1022 * @param[in] outlineColor The color that is set as outline color
1023 * @exception E_SUCCESS The method is successful.
1024 * @exception E_INVALID_ARG A specified input parameter is invalid.
1025 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1026 * @exception E_OPERATION_FAILED The operation has failed.
1028 * - The foreground color (RGB value only) of the %Canvas control is used as the text color.
1029 * - 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.
1031 result DrawText(const FloatPoint& point, const Tizen::Base::String& text, int length, const Color& outlineColor);
1034 * Draws an enriched text at the specified area.
1038 * @return An error code
1039 * @param[in] point The location to draw the text
1040 * @param[in] enrichedText The TextElement to draw
1041 * @exception E_SUCCESS The method is successful.
1042 * @exception E_DEVICE_UNAVAILABLE A specified device is invalid.
1044 * - The foreground color (RGB value only) of the %Canvas control is used as the text color.
1045 * - 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.
1047 result DrawText(const Point& point, const EnrichedText& enrichedText);
1050 * Draws an enriched text at a specified area.
1054 * @return An error code
1055 * @param[in] point The location to draw the text
1056 * @param[in] enrichedText The TextElement to draw
1057 * @exception E_SUCCESS The method is successful.
1058 * @exception E_DEVICE_UNAVAILABLE A specified device is invalid.
1060 * - The foreground color (RGB value only) of the %Canvas control is used as the text color.
1061 * - 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.
1063 result DrawText(const FloatPoint& point, const EnrichedText& enrichedText);
1066 * Draws a bitmap image at the specified location.
1070 * @return An error code
1071 * @param[in] point The location of the upper-left corner of the bitmap
1072 * @param[in] bitmap The bitmap to draw @n
1073 * It must be constructed before being passed into this
1074 * method. ::BITMAP_PIXEL_FORMAT_R8G8B8A8 is
1075 * not applicable for this method. The bitmap must not
1076 * entirely fall outside the edges of the %Canvas control. If
1077 * this condition is not satisfied, the @c E_OUT_OF_RANGE exception
1079 * @exception E_SUCCESS The method is successful.
1080 * @exception E_INVALID_ARG A specified input parameter is invalid.
1082 result DrawBitmap(const Point& point, const Bitmap& bitmap);
1085 * Draws a bitmap image at a specified location.
1089 * @return An error code
1090 * @param[in] point The location of the upper-left corner of the bitmap
1091 * @param[in] bitmap The bitmap to draw @n
1092 * It must be constructed before being passed into this
1093 * method. ::BITMAP_PIXEL_FORMAT_R8G8B8A8 is
1094 * not applicable for this method. The bitmap must not
1095 * entirely fall outside the edges of the %Canvas control. If
1096 * this condition is not satisfied, the @c E_OUT_OF_RANGE exception
1098 * @exception E_SUCCESS The method is successful.
1099 * @exception E_INVALID_ARG A specified input parameter is invalid.
1101 result DrawBitmap(const FloatPoint& point, const Bitmap& bitmap);
1104 * Draws a bitmap image at the specified location.
1108 * @return An error code
1109 * @param[in] rect The location and size of the scaled bitmap @n
1110 * The rectangle must not entirely fall outside the edges of the
1111 * %Canvas control. If this condition is not satisfied, the
1112 * @c E_OUT_OF_RANGE exception is returned.
1113 * @param[in] bitmap The bitmap to draw @n
1114 * It must be constructed well before being passed into this
1116 * @exception E_SUCCESS The method is successful.
1117 * @exception E_INVALID_ARG A specified input parameter is invalid.
1118 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1119 * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1121 result DrawBitmap(const Rectangle& rect, const Bitmap& bitmap);
1124 * Draws a bitmap image at a specified location.
1128 * @return An error code
1129 * @param[in] rect The location and size of the scaled bitmap @n
1130 * The rectangle must not entirely fall outside the edges of the
1131 * %Canvas control. If this condition is not satisfied, the
1132 * @c E_OUT_OF_RANGE exception is returned.
1133 * @param[in] bitmap The bitmap to draw @n
1134 * It must be constructed well before being passed into this
1136 * @exception E_SUCCESS The method is successful.
1137 * @exception E_INVALID_ARG A specified input parameter is invalid.
1138 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1139 * @remarks ::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1141 result DrawBitmap(const FloatRectangle& rect, const Bitmap& bitmap);
1144 * Draws a color data corresponding to a rectangle of pixels from the specified bitmap onto %Canvas.
1148 * @return An error code
1149 * @param[in] destRect The destination rectangle of %Canvas @n
1150 * The width and height of the rectangle must be greater than or equal to @c 0.
1151 * The rectangle defined by @c destRect will be clipped at the edges
1152 * of the %Canvas control to prevent the rectangle from falling
1153 * outside the edges of the %Canvas control. The destination
1154 * rectangle of a %Canvas control must not fall outside the edges
1155 * of the %Canvas control entirely. If these conditions are not
1156 * satisfied, the @c E_OUT_OF_RANGE exception is returned.
1157 * @param[in] srcBitmap The bitmap to draw
1158 * @param[in] srcRect The source rectangle of a bitmap @n
1159 * The width and height of the rectangle must be greater than or equal to @c 0.
1160 * The rectangle defined by @c srcRect will be clipped at the edges
1161 * of the bitmap to prevent the rectangle from falling outside the
1162 * edges of the bitmap. The source rectangle of a bitmap must not
1163 * fall outside the edges of the bitmap entirely. If these
1164 * conditions are not satisfied, the @c E_OUT_OF_RANGE exception is
1166 * @exception E_SUCCESS The method is successful.
1167 * @exception E_INVALID_ARG A specified input parameter is invalid.
1168 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1169 * @remarks If the source and destination rectangles are not of the same size,
1170 * the source bitmap is stretched to match the destination rectangle. @n
1171 * ::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1173 result DrawBitmap(const Rectangle& destRect, const Bitmap& srcBitmap, const Rectangle& srcRect);
1176 * Draws a color data corresponding to a rectangle of pixels from a specified bitmap onto %Canvas.
1180 * @return An error code
1181 * @param[in] destRect The destination rectangle of %Canvas @n
1182 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
1183 * The rectangle defined by @c destRect will be clipped at the edges
1184 * of the %Canvas control to prevent the rectangle from falling
1185 * outside the edges of the %Canvas control. The destination
1186 * rectangle of a %Canvas control must not fall outside the edges
1187 * of the %Canvas control entirely. If these conditions are not
1188 * satisfied, the @c E_OUT_OF_RANGE exception is returned.
1189 * @param[in] srcBitmap The bitmap to draw
1190 * @param[in] srcRect The source rectangle of a bitmap @n
1191 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
1192 * The rectangle defined by @c srcRect will be clipped at the edges
1193 * of the bitmap to prevent the rectangle from falling outside the
1194 * edges of the bitmap. The source rectangle of a bitmap must not
1195 * fall outside the edges of the bitmap entirely. If these
1196 * conditions are not satisfied, the @c E_OUT_OF_RANGE exception is
1198 * @exception E_SUCCESS The method is successful.
1199 * @exception E_INVALID_ARG A specified input parameter is invalid.
1200 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1201 * @remarks If the source and destination rectangles are not of the same size,
1202 * the source bitmap is stretched to match the destination rectangle. @n
1203 * ::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1205 result DrawBitmap(const FloatRectangle& destRect, const Bitmap& srcBitmap, const FloatRectangle& srcRect);
1208 * Draws a flipped bitmap image at the specified location.
1212 * @return An error code
1213 * @param[in] point The location to draw the bitmap
1214 * @param[in] bitmap The bitmap to draw @n
1215 * It must be constructed before being passed to this method.
1216 * @param[in] dir The flip direction
1217 * @exception E_SUCCESS The method is successful.
1218 * @exception E_INVALID_ARG A specified input parameter is invalid.
1219 * @remarks ::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1221 result DrawBitmap(const Point& point, const Bitmap& bitmap, FlipDirection dir);
1224 * Draws a flipped bitmap image at a specified location.
1228 * @return An error code
1229 * @param[in] point The location to draw the bitmap
1230 * @param[in] bitmap The bitmap to draw @n
1231 * It must be constructed before being passed to this method.
1232 * @param[in] dir The flip direction
1233 * @exception E_SUCCESS The method is successful.
1234 * @exception E_INVALID_ARG A specified input parameter is invalid.
1235 * @remarks ::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1237 result DrawBitmap(const FloatPoint& point, const Bitmap& bitmap, FlipDirection dir);
1240 * Draws a rotated bitmap image at the specified location.
1244 * @return An error code
1245 * @param[in] point A location to draw a bitmap image @n
1246 * This location is relatively defined from the origin (upper-left
1247 * corner) of the %Canvas control.
1248 * @param[in] bitmap The bitmap to draw @n
1249 * It must be constructed before being passed to this method.
1250 * @param[in] pivot The center of rotation of a bitmap image @n
1251 * This center is relatively defined from the origin (upper-left
1252 * corner) of the bitmap.
1253 * @param[in] degree The amount of rotation in degrees
1254 * @exception E_SUCCESS The method is successful.
1255 * @exception E_INVALID_ARG A specified input parameter is invalid.
1256 * @remarks ::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1257 * This method faces a problem while working in an unbounded region and it affects the whole Canvas pixels in the case of ::COMPOSITE_MODE_SRC or ::COMPOSITE_MODE_CLEAR.
1258 * @image html graphics_rotatebitmap.PNG
1260 result DrawBitmap(const Point& point, const Bitmap& bitmap, const Point& pivot, int degree);
1263 * Draws a rotated bitmap image at a specified location.
1267 * @return An error code
1268 * @param[in] point A location to draw a bitmap image @n
1269 * This location is relatively defined from the origin (upper-left
1270 * corner) of the %Canvas control.
1271 * @param[in] bitmap The bitmap to draw @n
1272 * It must be constructed before being passed to this method.
1273 * @param[in] pivot The center of rotation of a bitmap image @n
1274 * This center is relatively defined from the origin (upper-left
1275 * corner) of the bitmap.
1276 * @param[in] degree The amount of rotation in degrees
1277 * @exception E_SUCCESS The method is successful.
1278 * @exception E_INVALID_ARG A specified input parameter is invalid.
1279 * @remarks ::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
1280 * This method faces a problem while working in an unbounded region and it affects the whole %Canvas pixels in the case of ::COMPOSITE_MODE_SRC or ::COMPOSITE_MODE_CLEAR.
1281 * @image html graphics_rotatebitmap.PNG
1283 result DrawBitmap(const FloatPoint& point, const Bitmap& bitmap, const FloatPoint& pivot, float degree);
1286 * Draws a nine-patched bitmap at the specified location.
1290 * @return An error code
1291 * @param[in] rect The location and size of the nine-patched bitmap @n
1292 * The rectangle must not entirely fall outside the edges of the
1293 * %Canvas control. If this condition is not satisfied, the
1294 * @c E_OUT_OF_RANGE exception is returned.
1295 * @param[in] bitmap The bitmap to draw @n
1296 * It must be constructed before being passed to this method.
1297 * @exception E_SUCCESS The method is successful.
1298 * @exception E_INVALID_ARG A specified input parameter is invalid.
1299 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1300 * @remarks ::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method. @n
1301 * The nine-patched bitmap must have a stretchable section by drawing one (or more) 1-pixel-wide black line(s) in the
1302 * left and top part of the border.
1303 * @image html graphics_ninepatchedbitmap.PNG
1306 result DrawNinePatchedBitmap(const Rectangle& rect, const Bitmap& bitmap);
1309 * Draws a nine-patched bitmap at a specified location.
1313 * @return An error code
1314 * @param[in] rect The location and size of the nine-patched bitmap @n
1315 * The rectangle must not entirely fall outside the edges of the
1316 * %Canvas control. If this condition is not satisfied, the
1317 * @c E_OUT_OF_RANGE exception is returned.
1318 * @param[in] bitmap The bitmap to draw @n
1319 * It must be constructed before being passed to this method.
1320 * @exception E_SUCCESS The method is successful.
1321 * @exception E_INVALID_ARG A specified input parameter is invalid.
1322 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1323 * @remarks ::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method. @n
1324 * The nine-patched bitmap must have a stretchable section by drawing one (or more) 1-pixel-wide black line(s) in the
1325 * left and top part of the border.
1326 * @image html graphics_ninepatchedbitmap.PNG
1329 result DrawNinePatchedBitmap(const FloatRectangle& rect, const Bitmap& bitmap);
1332 * Shows the current instance of %Canvas on the device screen.
1335 * @brief <i> [Compatibility] </i>
1339 * @compatibility This method has compatibility issues with OSP compatible applications @n
1340 * For more information, see the issue description for @ref CompCanvasShowPage "here".
1343 * @return An error code
1344 * @exception E_SUCCESS The method is successful.
1345 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
1352 * @page CompCanvasShowPage Compatibility for Show().
1353 * @section CompCanvasShowPageIssueSection Issues
1354 * 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.
1356 * -# 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.
1357 * -# 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.
1365 * Shows the specified rectangle of the current instance of %Canvas on the device screen.
1367 * @brief <i> [Deprecated] </i>
1368 * @deprecated This method is deprecated. Instead of this method, use the Show().
1371 * @return An error code
1372 * @param[in] rect The bounds of the %Canvas control to display @n
1373 * The width and height of the rectangle must be greater than or equal to @c 0.
1374 * The rectangle must not entirely fall outside the edges of the
1375 * %Canvas control. If these conditions are not satisfied, the
1376 * @c E_OUT_OF_RANGE exception is returned.
1377 * @exception E_SUCCESS The method is successful.
1378 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1380 * @remark If you use Show(Rectangle&) in Tizen, this method works differently. @n
1381 * This method shows the screen entirely not partially in Tizen.
1384 result Show(const Rectangle& rect);
1387 * Gets the location and size of the current %Canvas instance on the device screen.
1391 * @return The Rectangle instance containing the location and size of the current %Canvas instance
1392 * @remarks If this %Canvas instance is a Window %Canvas, it returns Rectangle(0, 0, w, h).
1394 Rectangle GetBounds(void) const;
1397 * Gets the location and size of the current %Canvas instance on the device screen.
1401 * @return The FloatRectangle instance containing the location and size of the current %Canvas instance
1402 * @remarks If this %Canvas instance is a Window %Canvas, it returns FloatRectangle(0.0f, 0.0f, w, h).
1404 FloatRectangle GetBoundsF(void) const;
1407 * Gets the actual location and size of the current %Canvas instance on the device screen.
1411 * @return The FloatRectangle instance containing the actual location and size of the current %Canvas instance
1412 * @remarks If this %Canvas instance is a Window %Canvas, it returns FloatRectangle(0.0f, 0.0f, w, h).
1414 FloatRectangle GetActualBounds(void) const;
1417 * Sets the clip rectangle for a %Canvas control. @n
1418 * When a clip rectangle is set, any drawing is restricted within the specified rectangular area. The
1419 * rectangular area defined is clipped at the edges of the %Canvas control so as to prevent the clipped rectangle
1420 * from falling outside the %Canvas control.
1424 * @return An error code
1425 * @param[in] rect The bounds of the clip rectangle @n
1426 * The width and height of the rectangle must be greater than or equal to @c 0.
1427 * The clip rectangle for a %Canvas control must not entirely fall
1428 * outside the edges of the %Canvas control. If these conditions are
1429 * not satisfied, the @c E_OUT_OF_RANGE exception is returned.
1430 * @exception E_SUCCESS The method is successful.
1431 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1433 result SetClipBounds(const Rectangle& rect);
1436 * Sets the clip rectangle for a %Canvas control. @n
1437 * When a clip rectangle is set, any drawing is restricted within a specified rectangular area. The
1438 * rectangular area defined is clipped at the edges of the %Canvas control so as to prevent the clipped rectangle
1439 * from falling outside the %Canvas control.
1443 * @return An error code
1444 * @param[in] rect The bounds of the clip rectangle @n
1445 * The width and height of the rectangle must be greater than or equal to @c 0.0f.
1446 * The clip rectangle for a %Canvas control must not entirely fall
1447 * outside the edges of the %Canvas control. If these conditions are
1448 * not satisfied, the @c E_OUT_OF_RANGE exception is returned.
1449 * @exception E_SUCCESS The method is successful.
1450 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
1452 result SetClipBounds(const FloatRectangle& rect);
1455 * Gets the bounds of the clip rectangle of a %Canvas control.
1459 * @return An instance of Rectangle indicating the bounds of the clip rectangle
1461 Rectangle GetClipBounds(void) const;
1464 * Gets the bounds of the clip rectangle of a %Canvas control.
1468 * @return An instance of FloatRectangle indicating the bounds of the clip rectangle
1470 FloatRectangle GetClipBoundsF(void) const;
1473 * Locks the %Canvas control for direct pixel access. @n
1474 * This sets up a %Canvas control for accessing the pixels directly. Between the calls to the
1475 * %Canvas::Lock() and Canvas::Unlock() methods, the data can be written to and read from the
1476 * %Canvas control's pixels. Once the operations on the %Canvas control's pixels are finished, the
1477 * %Canvas::Unlock() method must be called to release the lock.
1481 * @return An error code
1482 * @param[out] info The information of the %Canvas control
1483 * @param[in] timeout The time, in milliseconds, that the caller waits to obtain the lock @n
1484 * If the lock attempt fails, @c E_TIMEOUT is returned. The default value
1485 * is @c INFINITE, which means that the method does not return until the lock
1487 * @exception E_SUCCESS The method is successful.
1488 * @exception E_TIMEOUT The operation cannot be completed within the specified time period.
1489 * @exception E_SYSTEM An unknown operating system error has occurred.
1490 * @remarks BufferInfo contains a valid physical memory information, regardless of the
1491 * logical position and size of the %Canvas control.
1493 result Lock(BufferInfo& info, long timeout = INFINITE);
1496 * Unlocks the %Canvas control.
1500 * @return An error code
1501 * @exception E_SUCCESS The method is successful.
1502 * @exception E_SYSTEM An unknown operating system error has occurred.
1503 * @remarks The %Canvas control must be unlocked as soon as possible.
1505 result Unlock(void);
1508 * Sets the foreground color.
1512 * @param[in] color The color that is set as foreground color
1514 void SetForegroundColor(const Color& color);
1517 * Gets the foreground color.
1521 * @return The foreground color
1523 Color GetForegroundColor(void) const;
1526 * Sets the background color.
1530 * @param[in] color The color that is set as background color
1532 void SetBackgroundColor(const Color& color);
1535 * Gets the background color.
1539 * @return The background color
1541 Color GetBackgroundColor(void) const;
1544 * Sets the current instance of %Canvas to the specified point.
1546 * @brief <i> [Deprecated] </i>
1547 * @deprecated This method is deprecated.
1550 * @return An error code
1551 * @param[in] point The new position
1552 * @exception E_SUCCESS The method is successful.
1553 * @exception E_UNSUPPORTED_OPERATION Window %Canvas does not support moving the position.
1554 * @remarks This method has been influenced on only Memory canvas. However, Show() for Memory canvas is not supported anymore.
1556 result SetPosition(const Point& point);
1559 * Sets the current instance of %Canvas to the specified point.
1561 * @brief <i> [Deprecated] </i>
1562 * @deprecated This method is deprecated.
1565 * @return An error code
1566 * @param[in] x The new x-coordinate
1567 * @param[in] y The new y-coordinate
1568 * @exception E_SUCCESS The method is successful.
1569 * @exception E_UNSUPPORTED_OPERATION Window %Canvas does not support moving the position.
1570 * @remarks This method has been influenced on only Memory canvas. However, Show() for Memory canvas is not supported anymore.
1572 result SetPosition(int x, int y);
1575 * Sets the composite mode.
1579 * @return An error code
1580 * @param[in] compositeMode The new composite mode
1581 * @exception E_SUCCESS The method is successful.
1582 * @exception E_INVALID_ARG The specified input parameter is invalid.
1584 result SetCompositeMode(CompositeMode compositeMode);
1587 * Gets the composite mode for the current instance.
1591 * @return The current composite mode
1592 * @remarks The default value is @c COMPOSITE_MODE_SRC_OVER.
1594 CompositeMode GetCompositeMode(void) const;
1597 * Enables or disables anti-aliasing to the current instance of %Canvas.
1601 * @param[in] enable Set to @c true to enable anti-aliasing for the current instance of %Canvas, @n
1603 * @remarks By default, the anti-aliasing is enabled.
1605 void SetAntiAliasingEnabled(bool enable);
1608 * Checks whether anti-aliasing is enabled to the current instance.
1612 * @return @c true if the anti-aliasing is enabled to the current instance.
1615 bool IsAntiAliasingEnabled(void) const;
1619 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
1621 Canvas(const Canvas& rhs);
1624 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
1626 Canvas& operator =(const Canvas& rhs);
1628 friend class Bitmap;
1629 friend class TextElement;
1632 friend class _CanvasImpl;
1635 // This variable is for internal use only.
1636 // Using this variable can cause behavioral, security-related, and consistency-related issues in the application.
1640 class _CanvasImpl* __pImpl;
1644 }} // Tizen::Graphics
1646 #endif //_FGRP_CANVAS_H_