BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Newbie bitmap question

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
MMPT
Guest





PostPosted: Wed Aug 24, 2005 10:43 am    Post subject: Newbie bitmap question Reply with quote



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





PostPosted: Wed Aug 24, 2005 11:24 am    Post subject: Re: Newbie bitmap question Reply with quote



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





PostPosted: Wed Aug 24, 2005 12:46 pm    Post subject: Re: Newbie bitmap question Reply with quote



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





PostPosted: Thu Aug 25, 2005 2:38 pm    Post subject: Re: Newbie bitmap question Reply with quote

The winapi group would be a better place for this question.

H^2
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.