T O P I C R E V I E W |
jwest |
Posted - Jun 17 2011 : 19:18:47 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 |
6 L A T E S T R E P L I E S (Newest First) |
jwest |
Posted - Jun 19 2011 : 17:49:57 Thank you, Mr Fabrizio |
fab |
Posted - Jun 19 2011 : 12:49:04 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. |
jwest |
Posted - Jun 19 2011 : 12:29:53 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 |
fab |
Posted - Jun 19 2011 : 11:48:26 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. |
jwest |
Posted - Jun 19 2011 : 10:40:48 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
|
fab |
Posted - Jun 17 2011 : 23:12:11 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. |
|
|