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
 Creating independent layer with TimageEnVect
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jwest

Brazil
67 Posts

Posted - Jun 17 2011 :  19:18:47  Show Profile  Reply
Hi,
I have a TimageEnVect with a dicom Image.

I need to create a layer to write tags on it with the TimageEnVect in background.

I can create the layer, but it always takes the rectangle dimensions of the TimageEnVect.iebitmap(where the image draws).

IŽd like to create a transparent layer with dimensions(left,top,right,width) of the TimageEnvect container and make it independent of the TimageEnVect zoom, in order to write some tags on it.

I have looking for some sample on demos, but I didn't found one. I tried vectorial sample, but it did not solve my problem completely.

How do I could to create this layer and write some text on the left upper corner on it?

Best Regards,

Luiz

fab

1310 Posts

Posted - Jun 17 2011 :  23:12:11  Show Profile  Reply
To create a layer of "width" x "height" write:

ImageEnVect1.LayersAdd(width, height);

Anyway it is not possible to associate vectorial objects to a layer other than the background layer (that is layer 0), so each vectorial object coordinates are always related to layer 0.

Also, it is not possible to create a layer that is independent by the zoom or scroll. All layers are zoomed and scrolled together.
Go to Top of Page

jwest

Brazil
67 Posts

Posted - Jun 19 2011 :  10:40:48  Show Profile  Reply
Mr Fabrizio,
Thank you for your reply.
I had to use:
with ImageEnVect1.Layers[i] do begin
Posx:=ConvXScr2Bmp(0);PosY:=ConvYScr2Bmp(0);
width:=trunc(ImageEnVect1.ClientWidth/(ImageEnVect1.Zoomx/100));
Height:= trunc(ImageEnVect1.ClientHeight/(ImageEnVect1.ZoomY/100));
end;
It seems create a layer over ImageEnVect1 external rectangle. So, now I am faced with a new problem setting the transparency with:
ImageEnVect1.Proc.Fill(CreateRGB(255,255,255));

ImageEnVect1.Proc.SetTransparentColors(CreateRGB(255, 255, 255),
CreateRGB(255,255, 255), 0);

With jpeg all is right, but It doesn't work with dicom image. The first time this code is executed I get no transparency and if I executed it next time, I get an access violation. Maybe a problem with alpha channel????

Please, is there a workaround?
Regards,

Luiz

Go to Top of Page

fab

1310 Posts

Posted - Jun 19 2011 :  11:48:26  Show Profile  Reply
The instruction...

ImageEnVect1.Proc.Fill(CreateRGB(255,255,255));

..and..

ImageEnVect1.Proc.SetTransparentColors(CreateRGB(255, 255, 255),
CreateRGB(255,255, 255), 0);

...applies only to RGB images, not 16 bit or 8 bit gray scale (formats very common in the DICOM world).
Make sure you have created the second layer as RGB:

ImageEnVect1.LayersAdd(width, height, ie24RGB);

Hence you can set all "whites" transparent with Se tTransparentColors.
If you use LayersAdd() without parameters it just clones the background image, using the same pixel format.

Finally, if you have loaded the second layer with an image (ie a DICOM), convert it to RGB:

ImageEnVect1.IEBitmap.PixelFormat := ie24RGB;
ImageEnVect1.Update();

Hope this helps.
Go to Top of Page

jwest

Brazil
67 Posts

Posted - Jun 19 2011 :  12:29:53  Show Profile  Reply
Hi,

My ImageEnVect1.LayersAdd version has no arguments. I can't use ImageEnVect1.LayersAdd(width, height, ie24RGB);

I only can use:
i:=ImageEnVect1.LayersAdd;
and
ImageEnVect1.Layers[i]

Regards,

Luiz
Go to Top of Page

fab

1310 Posts

Posted - Jun 19 2011 :  12:49:04  Show Profile  Reply
Please upgrade to version 3.1.2 to have that overloads.
Anyway you can still execute...

ImageEnVect1.Layers[i].Bitmap.PixelFormat :=ie24RGB;

...after the image is loaded.
Go to Top of Page

jwest

Brazil
67 Posts

Posted - Jun 19 2011 :  17:49:57  Show Profile  Reply
Thank you, Mr Fabrizio
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: