| View previous topic :: View next topic |
| Author |
Message |
MMPT Guest
|
Posted: Wed Aug 24, 2005 10:43 am Post subject: Newbie bitmap question |
|
|
Hi,
I have a bitmap on a timage object (CB6).
I have this struture defined:
struct BMP_IMAGE {
BITMAPFILEHEADER hdrFile; // BMP file header.
BITMAPINFOHEADER hdrInfo; // BMP info header.
unsigned char * pPalette; // Pointer to palette.
int paletteSize; // Palette size.
unsigned char * pData; // Pointer to image data.
int dataSize; // Image data size.
};
I need to use the bitmap on the Timage object on a variable of the above
structure. How can i do that? I've tried:
BITMAPINFO* bi;
BMP_IMAGE abmp;
bi = (BITMAPINFO*)new char[sizeof(BITMAPINFOHEADER)+4*sizeof(RGBQUAD)];
bi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bi->bmiHeader.biWidth = 720;
bi->bmiHeader.biHeight = 480;
bi->bmiHeader.biPlanes = 1;
bi->bmiHeader.biBitCount = 24;
bi->bmiHeader.biCompression = BI_RGB;
bi->bmiHeader.biSizeImage = bi->bmiHeader.biWidth*480;
bi->bmiHeader.biXPelsPerMeter = 0;
bi->bmiHeader.biYPelsPerMeter = 0;
bi->bmiHeader.biClrUsed= 0;
bi->bmiHeader.biClrImportant = 0;
long* pl = (long*)bi->bmiColors;
abmp.hdrInfo = bi->bmiHeader;
abmp.pData = Image1->Picture->Bitmap->Handle;
abmp.dataSize = 720*480;
The compiler says he can't convert void * to unsigned char *. I'm new to C.
How can i do this?
Thanks,
Miguel
|
|
| Back to top |
|
 |
Andrue Cope [TeamB] Guest
|
Posted: Wed Aug 24, 2005 11:24 am Post subject: Re: Newbie bitmap question |
|
|
This is not a C++ language issue. TBitmap is a VCL component and the
question should be asked in .VCL.COMPONENT.USING.
Borland also request that you post to the single most appropriate
newsgroups section only.
--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
|
|
| Back to top |
|
 |
Darko Miletic Guest
|
Posted: Wed Aug 24, 2005 12:46 pm Post subject: Re: Newbie bitmap question |
|
|
MMPT wrote:
| Quote: | Hi,
abmp.hdrInfo = bi->bmiHeader;
abmp.pData = Image1->Picture->Bitmap->Handle;
abmp.dataSize = 720*480;
The compiler says he can't convert void * to unsigned char *. I'm new to C.
How can i do this?
|
The compiler says that because your pData variable is unsigned char* and
Handle is void*. You should change definition of pData to windows type
HANDLE (which is typedef for void*).
It will work than OK.
|
|
| Back to top |
|
 |
Harold Howe [TeamB] Guest
|
Posted: Thu Aug 25, 2005 2:38 pm Post subject: Re: Newbie bitmap question |
|
|
The winapi group would be a better place for this question.
H^2
|
|
| Back to top |
|
 |
|