Skip to content

Commit 59368a5

Browse files
Update README.md
1 parent 806e618 commit 59368a5

File tree

1 file changed

+64
-1
lines changed

1 file changed

+64
-1
lines changed

README.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,67 @@
11
# VB6 MemoryDC
22
A memory DC class written in VB6. You can use this class to create and operate memory DCs easily.
33

4-
#Usage
4+
# Usage
5+
6+
## Initalizing MemoryDC class
7+
8+
To declare a MemoryDC typed variable, simply
9+
```VBS
10+
Dim memDC As New clsMemDC
11+
```
12+
13+
Next, you should create the DC when you need it:
14+
```VBS
15+
memDC.CreateMemDC image_width, image_height
16+
```
17+
For function `CreateMemDC`, please refer its description in "Functions Description" section.
18+
19+
## Deleting MemoryDC class
20+
21+
When you no longer need the MemoryDC typed variable, simply
22+
```VBS
23+
memDC.DeleteMemDC
24+
Set memDC = Nothing
25+
```
26+
27+
## Painting from other DCs
28+
29+
To paint the image from other DCs, simply
30+
```VBS
31+
memDC.BitBltFrom YourDC, FromX, FromY, ToX, ToY, image_width, image_height
32+
```
33+
34+
For function `BitBltFrom`, please refer its description in "Functions Description" section.
35+
36+
## Painting to other DCs
37+
38+
To paint the image to other DCs, simply
39+
```VBS
40+
memDC.BitBltTo YourDC, ToX, ToY, FromX, FromY, image_width, image_height
41+
```
42+
43+
For function `BitBltTo`, please refer its description in "Functions Description" section.
44+
45+
## Copying bit data to a Byte array
46+
47+
To copy the bit data of the image in the DC to a Byte array, simply
48+
```VBS
49+
memDC.CopyDataTo data 'data is a Byte() typed array variable
50+
```
51+
52+
For function `CopyDataTo`, please refer its description in "Functions Description" section.
53+
54+
## Copying bit data from a Byte array
55+
56+
To copy the bit data of the image in the DC from a Byte array, simply
57+
```VBS
58+
memDC.CopyDataFrom data 'data is a Byte() typed array variable
59+
```
60+
61+
For function `CopyDataFrom`, please refer its description in "Functions Description" section.
62+
63+
## For more functionalities, please read the following sections.
64+
65+
# Functions Description
66+
67+
# Property Description

0 commit comments

Comments
 (0)