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
 Convert Bitmap + transparent color to normal color

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
harry stahl Posted - Jul 21 2016 : 16:09:17
Is there an integrated function in imageen that converts a bitmap that has an alphavalue to a colorvalue withouth Alpha?

So that the bitmap without alpha value shows the same color on screen like the bitmap with alphacolor value?

HS
4   L A T E S T    R E P L I E S    (Newest First)
annieoroberts00 Posted - Jul 29 2016 : 01:04:43
thanks for the info
xequte Posted - Jul 26 2016 : 00:51:05
Hi

Added as IEApplyAlphaToColor() in v6.3.1.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
harry stahl Posted - Jul 21 2016 : 17:44:00
Thank you very much Bill, for your answer. So I assume there is not a function for it in ImageEn?

Then this could be a version to handle white also:

function DitherColor(AColor: TColor; AAlpha: Integer): TColor;
{ Dither a 32-bit color(with alpha value) to TColor.}
var
  iRGB: TRGB;
begin
  iRGB := TColor2TRGB(AColor);

  if (iRGB.r = 255) and (iRGB.g = 255) and (iRGB.b = 255) then begin
    iRGB.r := AAlpha;
    iRGB.g := AAlpha;
    iRGB.b := AAlpha;
  end else begin
    iRGB.r := Trunc(AAlpha / 255 * iRGB.r) + (255 - AAlpha);
    iRGB.g := Trunc(AAlpha / 255 * iRGB.g) + (255 - AAlpha);
    iRGB.b := Trunc(AAlpha / 255 * iRGB.b) + (255 - AAlpha);
  end;

  Result := TRGB2TColor(iRGB);
end;



HS
w2m Posted - Jul 21 2016 : 17:18:55
function DitherColor(AColor: TColor; AAlpha: Integer): TColor;
{ Dither a 32-bit color(with alpha value) to TColor.  This functions
  correctly for all colors except for clwhite. }
var
  iRGB: TRGB;
begin
  iRGB := TColor2TRGB(AColor);
  iRGB.r := Trunc(AAlpha / 255 * iRGB.r) + (255 - AAlpha);
  iRGB.g := Trunc(AAlpha / 255 * iRGB.g) + (255 - AAlpha);
  iRGB.b := Trunc(AAlpha / 255 * iRGB.b) + (255 - AAlpha);
  Result := TRGB2TColor(iRGB);
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development