ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Howto Set Palette TIEBitmap with SetPaletteEntries
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

zavf

Iran
22 Posts

Posted - Jun 13 2016 :  18:40:19  Show Profile  Reply
Hi My Friends

With this Code Palette Changed


    ImageEnView1.IEBitmap.Palette[AIndex] := TColor2TRGB(clGreen);
    ImageEnView1.Update;



But i use this code to set all entries palette, but this dont work

procedure ChangePalette;
var
  LogPal: TLogPalette;
  hPal: HPalette;
  PalEntry: array[0..255] of TPaletteEntry;
  i: Integer;
begin

  for i := 0 to 235 do 
  begin
    PalEntry[i].peRed := i;        
	PalEntry[i].peGreen := i;
    PalEntry[i].peBlue := i;
    PalEntry[i].peFlags := PC_NOCOLLAPSE;
  end;
  
  LogPal.palVersion := $300;
  LogPal.palNumEntries := 1;

  
  hPal := CreatePalette(LogPal);
  ResizePalette(hPal, 256);
  SetPaletteEntries(hPal, 0, 256, PalEntry);

  
  SelectPalette(ImageEnView1.IEBitmap.Canvas.Handle, hPal, FALSE);
 
  RealizePalette(ImageEnView1.IEBitmap.Canvas.Handle);
end;



and try this code , so dont work


procedure changePalette;
  pal: array[0..255] of TPALETTEENTRY;
begin
  pal[2].peRed   := 255;
  pal[2].peGreen := 100;
  pal[2].peBlue  := 0;
  pal[2].peFlags := 0;
  SetPaletteEntries(ImageEnView1.Bitmap.Palette, 2, 255, pal);
end;



Please Help Me

xequte

38682 Posts

Posted - Jun 18 2016 :  06:08:39  Show Profile  Reply
Hi

Have you tried using ConvertTo:

http://www.imageen.com/help/TImageEnProc.ConvertTo.html
or
http://www.imageen.com/help/TImageEnProc.ConvertToPalette.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: