Current News Archived News Search News Discussion Forum Old Forum Install Programs More Downloads... Troubleshooting Source Code Format Specs. Misc. Information Non-SF Stuff Links Small banner for links to this site: |
diff --git a/drawgrp/drawgrp.vcproj b/drawgrp/drawgrp.vcproj
--- a/drawgrp/drawgrp.vcproj
+++ b/drawgrp/drawgrp.vcproj
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
>\r
</Filter>\r
+ <File\r
+ RelativePath="..\grpapi\GrpApi.bas"\r
+ >\r
+ </File>\r
<File\r
RelativePath="ReadMe.txt"\r
>\r
diff --git a/grpapi/GrpApi.bas b/grpapi/GrpApi.bas
--- a/grpapi/GrpApi.bas
+++ b/grpapi/GrpApi.bas
' (&HBBGGRR).\r
' Note: Because of the extra calculations required,\r
' alpha blended graphics take longer to draw\r
+Public Const USE_INDEX As Long = &H10& ' Only valid when used with a custom SetPixel function.\r
+ ' This flag cannot be used in combination with\r
+ ' ALPHA_BLEND or SHADOW_COLOR\r
+ ' When this flag is used, the index to a color in the\r
+ ' palette will be passed to your custom SetPixel\r
+ ' function instead of the actual color.\r
\r
' Palette is an array of 256 Longs. Pass the first element of the array to these functions,\r
' rather than the actual array\r
Declare Function GetDC Lib "User32.dll" (ByVal hWnd As Long) As Long\r
Declare Function ReleaseDC Lib "User32.dll" (ByVal hWnd As Long, ByVal hDC As Long) As Long\r
\r
+' An array of the raw image data to encode should be passed to lpImageData. To do this,\r
+' pass the first byte of the array to the function. The size of the buffer containing\r
+' the data should be nFrames * wMaxWidth * wMaxHeight * 2\r
+' and the values should be arranged row by row of the frame, with the top row first.\r
+' After all the rows of a frame have been put into the buffer, the rows of the next frame\r
+' go after it. For transparent pixels, they should be set to -1. All other pixels should\r
+' have the high order byte set to zero, meaning that they should not be negative and the\r
+' values should not exceed 255 (&HFF). The values used for the colors are indexes into the\r
+' color palette.\r
+' Pass True to bNoCompress if you need an uncompressed GRP.\r
+' Pass a variable to nGrpSize to receive the size in bytes of the resulting encoded GRP.\r
+' The return value of this function is actually a pointer to the GRP data. This is what your\r
+' program should save to a file. The size of this buffer is the value received by nGrpSize.\r
+' When your program is done with the returned buffer, it should call DestroyGrp on the\r
+' buffer that was returned by this function to free up the memory from it.\r
+' The pointer returned by this function can also be directly used by DrawGrp or GetGrpInfo.\r
+Declare Function CreateGrp Lib "Grpapi.dll" (ByRef lpImageData As Integer, ByVal nFrames As Integer, ByVal wMaxWidth As Integer, ByVal wMaxHeight As Integer, ByVal bNoCompress As Boolean, ByRef nGrpSize As Long) As Long\r
+\r
+' Use this function to make a copy the memory at the location returned by CreateGrp.\r
+' Pass the address ByVal to Source. Pass either a byte array or a string to Destination.\r
+' The size of the array or string must be at least the size of the GRP data before\r
+' attempting to copy it to the array or string.\r
+' To pass a byte array, pass the first byte of the array ByRef. To pass a string,\r
+' pass the string ByVal.\r
+Declare Sub CopyMemory Lib "Kernel32.dll" _\r
+ Alias "RtlMoveMemory" ( _\r
+ ByRef Destination As Any, _\r
+ ByRef Source As Any, _\r
+ ByVal Length As Long)\r
+\r
' Call these to have DrawGrp use custom functions for reading and drawing pixels\r
' so that you can have it read from and write to a buffer, for example.\r
' Requires Visual Basic 5 or higher\r
' These no longer need to be called\r
Declare Function LoadGrpApi Lib "Grpapi.dll" () As Boolean\r
Declare Sub FreeGrpApi Lib "Grpapi.dll" ()\r
-\r
diff --git a/grpapi/grpapi.h b/grpapi/grpapi.h
--- a/grpapi/grpapi.h
+++ b/grpapi/grpapi.h
BOOL GRPAPI WINAPI DrawGrp(HANDLE hGrp, HDC hdcDest, int nXDest, int nYDest, WORD nFrame, DWORD *dwPalette, DWORD dwFlags, DWORD dwAlpha);\r
BOOL GRPAPI WINAPI GetGrpInfo(HANDLE hGrp, GRPHEADER *GrpInfo);\r
\r
+// A pointer to the raw image data to encode should be passed to lpImageData. The size of\r
+// the buffer containing the data should be nFrames * wMaxWidth * wMaxHeight * sizeof(short)\r
+// and the values should be arranged row by row of the frame, with the top row first.\r
+// After all the rows of a frame have been put into the buffer, the rows of the next frame\r
+// go after it. For transparent pixels, they should be set to -1. All other pixels should\r
+// have the high order byte set to zero, meaning that they should not be negative and the\r
+// values should not exceed 255 (0xFF). The values used for the colors are indexes into the\r
+// color palette.\r
+// Pass TRUE to bNoCompress if you need an uncompressed GRP.\r
+// Pass a pointer to a DWORD value to nGrpSize to receive the size in bytes of the resulting encoded GRP.\r
+// The return value of this function is actually a pointer to the GRP data. This is what your\r
+// program should save to a file. The size of this buffer is the value received by nGrpSize.\r
+// When your program is done with the returned buffer, it should call DestroyGrp on the\r
+// buffer that was returned by this function to free up the memory from it.\r
+// The pointer returned by this function can also be directly used by DrawGrp or GetGrpInfo.\r
HANDLE GRPAPI WINAPI CreateGrp(signed short *lpImageData, WORD nFrames, WORD wMaxWidth, WORD wMaxHeight, BOOL bNoCompress, DWORD *nGrpSize);\r
\r
typedef COLORREF (WINAPI* GETPIXELPROC)(\r
#endif\r
\r
#endif\r
-\r
diff --git a/grpapi/grpapi.rc b/grpapi/grpapi.rc
--- a/grpapi/grpapi.rc
+++ b/grpapi/grpapi.rc
//\r
\r
VS_VERSION_INFO VERSIONINFO\r
- FILEVERSION 1,0,1,1\r
- PRODUCTVERSION 1,0,1,1\r
+ FILEVERSION 1,1,0,1\r
+ PRODUCTVERSION 1,1,0,1\r
FILEFLAGSMASK 0x3fL\r
#ifdef _DEBUG\r
FILEFLAGS 0x1L\r
#else\r
VALUE "FileDescription", "ShadowFlare GRP Library\0"\r
#endif\r
- VALUE "FileVersion", "1.01\0"\r
+ VALUE "FileVersion", "1.10\0"\r
VALUE "InternalName", "grpapi\0"\r
VALUE "LegalCopyright", "Copyright © ShadowFlare Software 2002-2006\0"\r
VALUE "OriginalFilename", "grpapi.dll\0"\r
VALUE "ProductName", "GRP Library\0"\r
- VALUE "ProductVersion", "1, 0, 1, 1\0"\r
+ VALUE "ProductVersion", "1, 1, 0, 1\0"\r
VALUE "Web Address", "http://shadowflare.samods.org/\0"\r
END\r
END\r
diff --git a/grpapi/grpapi_no-lib.h b/grpapi/grpapi_no-lib.h
--- a/grpapi/grpapi_no-lib.h
+++ b/grpapi/grpapi_no-lib.h
extern funcDrawGrp DrawGrp;\r
extern funcGetGrpInfo GetGrpInfo;\r
\r
+// A pointer to the raw image data to encode should be passed to lpImageData. The size of\r
+// the buffer containing the data should be nFrames * wMaxWidth * wMaxHeight * sizeof(short)\r
+// and the values should be arranged row by row of the frame, with the top row first.\r
+// After all the rows of a frame have been put into the buffer, the rows of the next frame\r
+// go after it. For transparent pixels, they should be set to -1. All other pixels should\r
+// have the high order byte set to zero, meaning that they should not be negative and the\r
+// values should not exceed 255 (0xFF). The values used for the colors are indexes into the\r
+// color palette.\r
+// Pass TRUE to bNoCompress if you need an uncompressed GRP.\r
+// Pass a pointer to a DWORD value to nGrpSize to receive the size in bytes of the resulting encoded GRP.\r
+// The return value of this function is actually a pointer to the GRP data. This is what your\r
+// program should save to a file. The size of this buffer is the value received by nGrpSize.\r
+// When your program is done with the returned buffer, it should call DestroyGrp on the\r
+// buffer that was returned by this function to free up the memory from it.\r
+// The pointer returned by this function can also be directly used by DrawGrp or GetGrpInfo.\r
typedef HANDLE (WINAPI* funcCreateGrp)(signed short *lpImageData, WORD nFrames, WORD wMaxWidth, WORD wMaxHeight, BOOL bNoCompress, DWORD *nGrpSize);\r
extern funcCreateGrp CreateGrp;\r
\r
#endif\r
\r
#endif\r
-\r
|