LEADTOOLS Support
Imaging
Imaging SDK Questions
How do I change 256 color palette that user make the 256 color palette
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, November 29, 2005 4:09:46 PM(UTC)
Groups: Registered
Posts: 1
hi
I want to change 256 color bmp file from all bmp files. also want to apply user 256 color palette.
I tested with LeadTools.
=================Tested Source Start ============================
LPLOGPALETTE pLogPalette = (LPLOGPALETTE) malloc( sizeof( LOGPALETTE ) + sizeof( PALETTEENTRY ) * 255 );
if( NULL != pLogPalette )
{
pLogPalette->palVersion = 0x300;
pLogPalette->palNumEntries = 256;
for( L_INT16 i = 0 ; i < pLogPalette->palNumEntries ; i++ )
{
pLogPalette->palPalEntry[ i ].peRed = GetRValue( pList->GetItemData( k ) );
pLogPalette->palPalEntry[ i ].peGreen = GetGValue( pList->GetItemData( k ) );
pLogPalette->palPalEntry[ i ].peBlue = GetBValue( pList->GetItemData( k ) );
pLogPalette->palPalEntry[ i ].peFlags = 0;
}
HPALETTE hPalette = CreatePalette( pLogPalette );
LBitmapBase BitmapBase;
BitmapBase.Load("C:\temp\test.bmp"); // 'test.bmp' is 24bit color bmp file
BitmapBase.SetPalette(hPalette);
BitmapBase.Save(FILE_BMP, 8, 2); // Not apply to user 256 color palette
DeleteObject( hPalette );
}
free( pLogPalette );
=================Tested Source End ============================
How can I change user 256 color palette?
Please help me.
#2
Posted
:
Monday, December 5, 2005 5:21:42 AM(UTC)
Groups: Registered, Tech Support
Posts: 20
To use your custom palette use L_ColorResBitmap, This function provides flexibility in specifying the output destination and in specifying the palette to use.
For more information, please refer to L_ ColorResBitmap in the Main API help file.
Thanks,
Ali Abo Al-Rob
LEADTOOLS Technical Support
704-332-5532 voice
704-372-8116 fax
http://support.leadtools.comEdited by moderator Thursday, December 8, 2016 2:23:02 PM(UTC)
| Reason: Not specified
LEADTOOLS Support
Imaging
Imaging SDK Questions
How do I change 256 color palette that user make the 256 color palette
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.