You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`FromHdc`: Long, Specifics the DC handle to paint image from.
142
+
143
+
`FromX`: Long, X position of the original image.
144
+
145
+
`FromY`: Long, Y position of the original image.
146
+
147
+
`ToX`: Long, X position of the target image.
148
+
149
+
`ToY`: Long, Y position of the target image.
150
+
151
+
`iWidth`: Long, width of the image being painted
152
+
153
+
`iHeight`: Long, height of the image being painted
154
+
155
+
`DrawMode`: Optional, RasterOpConstants, specifics painting mode. Default is `vbSrcCopy Or BITBLT_TRANSPARENT_WINDOWS`. Painting mode can be the combination of the following constants:
156
+
157
+
| RasterOpConstants |
158
+
|-------------------|
159
+
| vbDstInvert |
160
+
| vbMergeCopy |
161
+
| vbMergePaint |
162
+
| vbNotSrcCopy |
163
+
| vbNotSrcErase |
164
+
| vbPatCopy |
165
+
| vbPatInvert |
166
+
| vbPatPaint |
167
+
| vbSrcAnd |
168
+
| vbSrcCopy |
169
+
| vbSrcErase |
170
+
| vbSrcInvert |
171
+
| vbSrcPaint |
172
+
173
+
### Return value
174
+
175
+
Type: `Boolean`
176
+
177
+
If the image is painted successfully, the function returns `True`. Otherwise, the function returns `False`.
178
+
179
+
### Examples
180
+
181
+
```VBS
182
+
memDC.BitBltFromfrmMain.hDC,0,0,0,0,100,100'Paints the image from frmMain.hDC, from (0, 0) of the window to (0, 0) of the memory DC, sized 100 * 100
183
+
```
184
+
185
+
```VBS
186
+
memDC.BitBltFromGetDC(0),100,200,150,250,300,400,vbSrcInvert'Paints the image from the screen DC, from (100, 200) of the screen to (150, 250) of the memory DC, sized 300 * 400, using vbSrcInvert painting mode
187
+
```
188
+
189
+
## `BitBltTo` function
190
+
191
+
`BitBltTo` paints image from the created memory DC to other DCs.
`ToHdc`: Long, Specifics the DC handle to paint image to.
203
+
204
+
`ToX`: Long, X position of the target image.
205
+
206
+
`ToY`: Long, Y position of the target image.
207
+
208
+
`FromX`: Long, X position of the original image.
209
+
210
+
`FromY`: Long, Y position of the original image.
211
+
212
+
`iWidth`: Long, width of the image being painted
213
+
214
+
`iHeight`: Long, height of the image being painted
215
+
216
+
`DrawMode`: Optional, RasterOpConstants, specifics painting mode. Default is `vbSrcCopy Or BITBLT_TRANSPARENT_WINDOWS`. For constants available for DrawMode, please refer to "`BitBltFrom` function" section.
217
+
218
+
### Return value
219
+
220
+
Type: `Boolean`
221
+
222
+
If the image is painted successfully, the function returns `True`. Otherwise, the function returns `False`.
223
+
224
+
### Examples
225
+
226
+
```VBS
227
+
memDC.BitBltTofrmMain.hDC,0,0,0,0,100,100'Paints the image to frmMain.hDC, from (0, 0) of the memory DC to (0, 0) of the window, sized 100 * 100
228
+
```
229
+
230
+
```VBS
231
+
memDC.BitBltToGetDC(0),100,200,150,250,300,400,vbSrcInvert'Paints the image to the screen DC, from (100, 200) of the memory DC to (150, 250) of the screen DC, sized 300 * 400, using vbSrcInvert painting mode
232
+
```
233
+
234
+
## `CopyDataFrom` function
235
+
236
+
`CopyDataFrom` function copies data from a Byte array to the memory DC.
237
+
238
+
### Definition
239
+
240
+
```VBS
241
+
PublicSubCopyDataFrom(FromArray()AsByte)
242
+
```
243
+
244
+
### Parameters
245
+
246
+
`FromArray`: Byte(), the Byte array to copy data from.
247
+
248
+
### Examples
249
+
250
+
```VBS
251
+
memDC.CopyDataFromdata'Copy image data from data, where data is a Byte array
252
+
```
253
+
254
+
**NOTE: `CopyDataFrom` function copies all data from the array to the memory region of the memory DC. So it checks if the array size is larger than the size of memory region of the memory DC or not. If the memory region is smaller than the size of the array, it only copies data in the same size to the size of memory region of the memory DC. For example, if the array is 10 bytes, and the size of the memory region of the memory DC is 5 bytes, this function will only copy 5 bytes from the array.**
255
+
256
+
## `CopyDataTo` function
257
+
258
+
`CopyDataFrom` function copies data from the memory DC to a Byte array.
`ToArray`: Byte(), the Byte array to copy data to.
269
+
270
+
### Return value
271
+
272
+
Type: `Boolean`
273
+
274
+
If the data is copied successfully, the function returns `True`. Otherwise, the function returns `False`.
275
+
276
+
### Examples
277
+
278
+
```VBS
279
+
memDC.CopyDataTodata'Copy image data to data, where data is a Byte array
280
+
```
281
+
282
+
**NOTE: `CopyDataTo` function copies all data from the memory region of the memory DC to the array. So it checks if the array size is large enough to receive the memory DC data or not. If the memory region is larger than the size of the array, this function fails. For example, if the array is 5 bytes, and the size of the memory region of the memory DC is 10 bytes, this function will return `False`**
283
+
284
+
# Properties Description
285
+
286
+
`iWidth`: Long, the width of the memory DC.
287
+
288
+
`iHeight`: Long, the height of the memory DC.
289
+
290
+
`iBitCount`: Long, the color bit count of the memory DC.
291
+
292
+
`iImageSize`: Long, the size of the memory region of the memory DC.
293
+
294
+
`hDC`: Long, the handle to the created memory DC.
295
+
296
+
`hBmp`: Long, the handle to the bitmap created. This bitmap is created together with the memory DC.
297
+
298
+
`lpBitData`: Long, the address of the memory region of the memory DC.
0 commit comments