#include "BitMapObject.h"
-static void ConvertToVBPalette();
+// static void ConvertToVBPalette();
static long Get_ByteWidth();
static long Get_LineLength();
static void ReDimArrays();
// --- MTSTransactionMode = 0 'NotAnMTSObject // NotAnMTSObject
// --- END
-static char *VB_Name = "BitMapObject";
-static boolean VB_GlobalNameSpace = False;
-static boolean VB_Creatable = True;
-static boolean VB_PredeclaredId = False;
-static boolean VB_Exposed = False;
+// static char *VB_Name = "BitMapObject";
+// static boolean VB_GlobalNameSpace = False;
+// static boolean VB_Creatable = True;
+// static boolean VB_PredeclaredId = False;
+// static boolean VB_Exposed = False;
+
// --- Option Explicit
// info von http://web.usxchange.net/elmo/bmp.htm
ReDimArrays();
}
+#if 0
+
void BitMapObject_CreateFromFile(char *Path)
{
long FNum;
void BitMapObject_SaveToFile(char *Path)
{
- long FNum;
+ FILE *FNum;
BMFH.bfOffBits = Len(BMFH) + Len(BMIH);
if (BMIH.biBitCount < 9)
BMIH.biSizeImage = Get_LineLength() * BMIH.biHeight;
BMFH.bfSize = BMFH.bfOffBits + BMIH.biSizeImage;
- FNum = FreeFile();
+ // FNum = FreeFile();
FNum = fopen(Path, "wb");
FILE_PUT(FNum, -1, &BMFH, sizeof(BMFH));
FILE_PUT(FNum, -1, &BMIH, sizeof(BMIH));
}
}
+#endif
+
static void ReDimArrays()
{
{
return ColorsUsed;
}
+#if 0
+
long BitMapObject_Get_ColorIndex(long X, long Y)
{
long ColorIndex;
{
case 1:
ColIndex = GetPaletteIndex(NewColor);
- ByteVal = ImageDataBytes[X / 8, nY];
+ ByteVal = ImageDataBytes[X / 8][nY];
BitPos = 7 - (X % 8);
NewX = (1 << BitPos);
ColIndex = ColIndex * NewX;
ByteVal = (ByteVal | NewX);
}
- ImageDataBytes[X / 8, nY] = ByteVal;
+ ImageDataBytes[X / 8][nY] = ByteVal;
break;
case 4:
ColIndex = GetPaletteIndex(NewColor);
- ByteVal = ImageDataBytes[X / 2, nY];
+ ByteVal = ImageDataBytes[X / 2][nY];
if ((X % 2) == 0)
{
ByteVal = (ByteVal & 0xF) + ColIndex * 0x10;
ByteVal = (ByteVal & 0xF0) + ColIndex;
}
- ImageDataBytes[X / 2, nY] = ByteVal;
+ ImageDataBytes[X / 2][nY] = ByteVal;
break;
case 8:
- ImageDataBytes[X, nY] = GetPaletteIndex(NewColor);
+ ImageDataBytes[X][nY] = GetPaletteIndex(NewColor);
break;
case 24:
NewX = 3 * X;
- ImageDataBytes[NewX, nY] = (NewColor & 0xFF0000) / 0x10000; // B
- ImageDataBytes[NewX + 1, nY] = (NewColor & 0xFF00) / 0x100; // G
- ImageDataBytes[NewX + 2, nY] = (NewColor & 0xFF); // R
+ ImageDataBytes[NewX][nY] = (NewColor & 0xFF0000) / 0x10000; // B
+ ImageDataBytes[NewX + 1][nY] = (NewColor & 0xFF00) / 0x100; // G
+ ImageDataBytes[NewX + 2][nY] = (NewColor & 0xFF); // R
break;
default:
return GetPaletteIndex;
}
+#endif
+
long BitMapObject_Get_Width()
{
long Width;
return Height;
}
+#if 0
+
BitMapObject BitMapObject_GetStretchCopy(float StretchVal)
{
BitMapObject GetStretchCopy;
{
for (iX = 0; iX <= nWidth; iX++)
{
- GetStretchCopy.Let_ColorIndex(iX, iY, ColorIndex(Int(iX / StretchVal), Int(iY / StretchVal)));
+ GetStretchCopy.Let_ColorIndex(iX, iY, ColorIndex((int)(iX / StretchVal), (int)(iY / StretchVal)));
}
}
return GetStretchCopy;
}
+
+#endif