Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, November 29, 2005 4:09:46 PM(UTC)
kangpower

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.

 

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, December 5, 2005 5:21:42 AM(UTC)

support  
support

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.com

Edited by moderator Thursday, December 8, 2016 2:23:02 PM(UTC)  | Reason: Not specified

 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.093 seconds.