25c9c0cfca85033050f27f9392088c10d5a28ac2
[sdk] / doc / ecere / ecere / gfx / Display.econ
1 {
2    name = "Display",
3    description = "A class representing 2D and 3D video graphics output such as a top-level window",
4    methods = [
5       {
6          "Grab",
7          {
8             description = "The Grab method is used to copy pixel data from a given rectangular area in the current window display to a bitmap instance.",
9             usage = "Grab is typically called on the display property of a Window instance to grab the content of the window.",
10             example = "void GrabWindowToBitmapFile(Window window, char * filePath, char * format)\n"
11                "{\n"
12                "   Bitmap bitmap { };\n"
13                "   window.display.Grab(bitmap, 0, 0, window.size.w, window.size.h);\n"
14                "   bitmap.Save(filePath, format, null);\n"
15                "   delete bitmap;\n"
16                "}",
17             remarks = "When no memory has been allocated in the bitmap instance to contain the pixel data, Grab will automatically allocate memory according to the size of the rectangular area being copied and to the pixel format of the display. When memory has been pre-allocated, Grab will use the bitmap if it satisfies the required size and pixel format. If the pre-allocated bitmap is not sufficient, Grab will enlarge the allocated memory and change the pixel format appropriately.",
18             also = "Bitmap::Save",
19             parameters = [
20                {
21                   "bitmap",
22                   {
23                      description = "Bitmap instance where the pixel data will be copied.",
24                      position = 1
25                   }
26                },
27                {
28                   "h",
29                   {
30                      description = "Height of the rectangular area.",
31                      position = 5
32                   }
33                },
34                {
35                   "w",
36                   {
37                      description = "Width of the rectangular area.",
38                      position = 4
39                   }
40                },
41                {
42                   "x",
43                   {
44                      description = "Distance from the left of the display to the top-left corner of the rectangular area.",
45                      position = 2
46                   }
47                },
48                {
49                   "y",
50                   {
51                      description = "Distance from the top of the display to the top-left corner of the rectangular area.",
52                      position = 3
53                   }
54                }
55             ],
56             returnValue = "true if pixel data was copied, otherwise false."
57          }
58       }
59    ]
60 }