Hello all,
1. Am I correct in assuming that there is no need to clean up after using CopyMemory API when it is used to copy between two VB6 declared arrays? It does not have it's own secret cache, or anything, does it?
2. Is CopyMemory a problem in any version of Windows now? I thought I had read that it was replaced by another method.
Form level general declarations
Form level code below needs two picture boxes, one named PicNew and one named PicOrg. PicOrg needs an embedded JPG picture.Code:Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long) Dim PicNew() As RGBQUAD '// Holds new picture for manipuation Dim PicOrg() As RGBQUAD '// Holds original jpg picture source Dim OrgLng As Long '// Holds the picture size for CopyMemory API
Thanks!Code:' // Create a buffer for photos using VB6 ReDim PicNew(0 To Pic.ScaleWidth - 1, 0 To Pic.ScaleHeight - 1) ReDim PicOrg(0 To Pic.ScaleWidth - 1, 0 To Pic.ScaleHeight - 1) ' // Get the size of the original photo for CopyMemory to use OrgLng = (UBound(PicOrg, 1) + 1) * (UBound(PicOrg, 2) + 1) * 4 ' // Copy from one VB6 declared array to another CopyMemory PicNew(0, 0), PicOrg(0, 0), OrgLng
Quiver




Reply With Quote