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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Howto Set Palette TIEBitmap with SetPaletteEntries

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
zavf Posted - Jun 13 2016 : 18:40:19
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
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 18 2016 : 06:08:39
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