xtd 0.2.0
Loading...
Searching...
No Matches
buffered_graphics_context.h
Go to the documentation of this file.
1
4#pragma once
5#include "buffered_graphics.h"
6#include "graphics.h"
7#include "point.h"
8#include "size.h"
9#include <xtd/optional>
10#include <xtd/object>
11#include <xtd/types>
12
14namespace xtd {
16 namespace drawing {
33 public:
35
41
43
48 const xtd::drawing::size& maximum_buffer() const noexcept;
53 buffered_graphics_context& maximum_buffer(const xtd::drawing::size& value);
55
57
59 void allocate(const xtd::drawing::graphics& target_graphics, const xtd::drawing::rectangle& targat_rectangle);
60 void allocate(intptr target_dc, const xtd::drawing::rectangle& targat_rectangle);
61
64 void invalidate();
66
67 private:
68 //xtd::drawing::buffered_graphics alloc_buffer_in_temp_manager(const xtd::drawing::graphics* target_graphics, intptr target_dc, const xtd::drawing::rectangle& target_rectangle);
69 //xtd::drawing::buffered_graphics allocate_buffer(const xtd::drawing::graphics* target_graphics, intptr target_dc, const xtd::drawing::rectangle& target_rectangle);
70 void destroy();
71
72 inline static const int BUFFER_FREE = 0; //the graphics buffer is free to use
73 inline static const int BUFFER_BUSY_PAINTING = 1; //graphics buffer is busy being created/painting
74 inline static const int BUFFER_BUSY_DESTROYING = 2; //graphics buffer is busy destroying
75
76 xtd::drawing::buffered_graphics buffer_;
77 xtd::drawing::size buffered_size_;
78 int busy_ = BUFFER_FREE;
79 xtd::drawing::graphics compat_graphics_;
80 bool invalidate_when_free_ = false;
81 xtd::drawing::size maximum_buffer_ {75 * 3, 32 * 3}; //by defualt, the size of our maxbuffer will be 3 x standard button size.
82 xtd::drawing::point target_location_;
83 xtd::drawing::size virtual_size_;
84 };
85 }
86}
Contains xtd::drawing::buffered_graphics class.
Provides methods for creating graphics buffers that can be used for double buffering.
Definition buffered_graphics_context.h:32
const xtd::drawing::size & maximum_buffer() const noexcept
Gets the maximum size of the buffer to use.
buffered_graphics_context()=default
Initializes a new instance of the BufferedGraphicsContext class.
Provides a graphics buffer for double buffering.
Definition buffered_graphics.h:32
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics.h:70
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.h:54
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.h:44
Stores an ordered pair of integers, which specify a height and width.
Definition size.h:31
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
Contains xtd::drawing::graphics class.
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.h:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::drawing::point class.
Contains xtd::drawing::size class.