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
 backobject to transparent Layer
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

klausdoege

Germany
389 Posts

Posted - Jan 15 2012 :  15:39:14  Show Profile  Reply
Hello,
as I can insert a text-object into a transparently layer.
If the background of the layer is colored, I see the text,
when the background is transparently, I see nothing.
With canvastextout, that perfectly works out, why not with the text-object.
Does somebody have an idea?

Klaus
www.klausdoege.de

fab

1310 Posts

Posted - Jan 16 2012 :  13:03:03  Show Profile  Reply
Hello,
text-object should be visible also on a transparent layer (or background).
Look at this code:


  // load background image
  ImageEnVect1.IO.LoadFromFile('background');

  // add a transparent layer (500x500), and move it at (100,100)
  ImageEnVect1.LayersAdd();
  ImageEnVect1.CurrentLayer.PosX := 100;
  ImageEnVect1.CurrentLayer.PosY := 100;
  ImageEnVect1.IEBitmap.Allocate(500, 500);
  ImageEnVect1.IEBitmap.AlphaChannel.Fill(0);
  ImageEnVect1.Update();

  // add a text object (without background)
  ImageEnVect1.ObjText[-1] := 'Test';
  ImageEnVect1.ObjBrushStyle[-1] := bsClear;
  ImageEnVect1.SetObjRect(-1, Rect(0,0,100,50));
  ImageEnVect1.ObjPenColor[-1] := clRed;
  ImageEnVect1.ObjKind[-1] := iekTEXT;
  ImageEnVect1.ObjLayer[-1] := 1;
  ImageEnVect1.AddNewObject();
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Jan 19 2012 :  15:55:38  Show Profile  Reply
Hello fabrizio,
yes this works fine, but i will insert a Textobject into a transparent layer.
When i use after imageencect1.addobject() -> ImageEnVect1.CopyObjectsToBack
then i see this object not in my transparent layer.
Why ?


Klaus
www.klausdoege.de
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Jan 20 2012 :  06:18:07  Show Profile  Reply
Hello Fabrizio,
after a few tests, I believe, ImageEnVect1.CopyObjectsToBack; doesn't process that alpha canal.
If I fill the alpha canal with ImageEnVect1.IEBitmap.AlphaChannel.Fill(150) then, I see the object 50% too approximately.
But ImageEnVect1.IEBitmap.AlphaChannel.Fill(0) and
ImageEnVect1.CopyObjectsToBack
should show the area of the object.
Can your that corrects?

Klaus
www.klausdoege.de
Go to Top of Page

fab

1310 Posts

Posted - Jan 20 2012 :  07:44:31  Show Profile  Reply
Hi,
yes, if we are speaking about CopyObjectsToBack, actually it doesn't allow to draw (correctly) over images with alpha channel.
Anyway it is already fixed and available in currently developing version. Please send a support message to try it.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: