|
1 | 1 | # VB6 MemoryDC
|
2 | 2 | A memory DC class written in VB6. You can use this class to create and operate memory DCs easily.
|
3 | 3 |
|
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