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
 AddLayer
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Orlando

3 Posts

Posted - Jun 29 2011 :  12:12:11  Show Profile  Reply
Hello, i have a problem when i add a layer to an TImageEnView component and increase the size of the layer added.

I don't understand why the layer added, have a gray color in the incremented area.

This is my code:


procedure AddWhiteLayer(imgev: TImageEnView);
var
idx: Integer;
begin
imgev.LayersSync := False;
idx := imgevActiveImage.LayersAdd(imgev.Bitmap.Width, imgev.Bitmap.Height + 300);
imgev.Layers[idx].Bitmap.Fill(clWhite);
imgev.Proc.SetTransparentColors(CreateRGB(255, 255, 255), CreateRGB(255, 255, 255), 0);
imgev.Layers[idx].Transparency := 100;
imgev.LayersMergeAll;
end;


I wanted to attach a screenshot of my application with the problem but when i did that, appeared the next error:
Microsoft VBScript runtime error '800a004c'
Path not found
/imageen/forum/outputFile.asp, line 159


Thanks in advance.


Orlando

w2m

USA
1990 Posts

Posted - Jun 29 2011 :  13:10:45  Show Profile  Reply
I do not understand why you are trying to do this. What you are doing is:
1. adding a layer and setting it dimensions
2. filling it with white
3. setting the transparent color to white.
4. setting the layers alpha to 100 which is about 40% opacity. A layers transparency is actually alpha whis is defined as 0 to 255 not percent.
5. merging the layer which removes the alphachannel.

When you do LayersMergeAll the resulting bitmap will be always 24 bit (ie24RGB). A 24bit bitmap does not have transparency.

What are you trying to do?
Do you want a 32-bit transparent layer of a specific size with alphachannel?
Do you want a 24-bit white layer of specific size with no alphachannel?


William Miller
Go to Top of Page

Orlando

3 Posts

Posted - Jun 29 2011 :  13:40:08  Show Profile  Reply
Hello William, thanks for your answer.

For simplicity, I removed some code.

I want to add text to the end of the image, for this, add a layer, increasing its size, add text, and mix the two layers.

I do not know another way to do this.


Orlando
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jun 29 2011 :  14:22:10  Show Profile  Reply
So you have it working or still need help?

William Miller
Go to Top of Page

Orlando

3 Posts

Posted - Jun 30 2011 :  14:24:19  Show Profile  Reply
William, I solved my problem in another way.

Thanks a lot for your help :-)


Orlando
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: