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
 "Not enough storage..." - LayersMerge (URGENT)

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
AndyColmes Posted - Mar 05 2016 : 20:01:25
I am having issues with LayersMerge when dealing with some images. The images are about 5000x4000 pixels. I get the error message "Not enough storage to process this command". It works with smaller images but not with images of this size. This is absolutely necessary for us to have this function. If you can provide an alternative method on how to do this, it would be greatly appreciated.

Here is a snippet of my code:


               VTempImageENVect.LayersAdd;
               VTempImageENVect.LayersCurrent := 0;
               VTempImageEnVect.IO.LoadFromStream( A3Stream );
               VTempImageEnVect.LayersCurrent := 1;
               VTempImageENVect.Layers[ 1 ].Bitmap.Assign( VTempMaster.Bitmap );
               VTempImageEnVect.Layers[ 1 ].Transparency := 150;
               VTempImageEnVect.Update;
               VTempImageEnVect.LayersMerge;      <--- "Not enough storage to process this command


Thanks

Andy
8   L A T E S T    R E P L I E S    (Newest First)
nwscomps Posted - Mar 14 2016 : 12:13:09
Hello,
maybe it can help to make sure that legacybitmap is set to false.
Also if layermerge uses any tbitmap internally, that can cause the problem.



Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
xequte Posted - Mar 13 2016 : 22:53:09
Hi Andy

I cannot reproduce that. Does the transparency show in VCastVect? Is EnableAlphaChannel true for both TImageEnViews? (Note: if you are not using any vectorial features then you would be better to use TImageEnViews rather than TImageEnVects).



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
AndyColmes Posted - Mar 13 2016 : 00:08:31
I am actually using 2 TimageEnVects for this, VCastVect and VTempImageENVect. The VCastVect does all the image effects where the background is changed to transparent. I had to save VCastVect to a png file first and load it to the layer of VTempImageENVect to preserve the transparency:


                  VCastVect.IO.SaveToFile( 'c:\new-cast.png' );

                  VTempImageENVect.LayersAdd;
                  VTempImageEnVect.LayersCurrent := 1;
                  VTempImageENVect.IO.LoadFromFilePNG( 'c:\new-cast.png' );
                  VTempImageENVect.Layers[ 1 ].PosX := 0;
                  VTempImageENVect.Layers[ 1 ].PosY := 0;
                  VTempImageENVect.Layers[ 1 ].Width := VCastVect.IEBitmap.Width;
                  VTempImageENVect.Layers[ 1 ].Height := VCastVect.IEBitmap.Height;
                  VTempImageEnVect.LayersMergeAll(True);
                  VTempImageEnVect.Update;



I tried doing the following, but the transparency in VCastVect did not transfer to the layer of VTempImageENVect:


                  VTempImageENVect.LayersAdd;
                  VTempImageEnVect.LayersCurrent := 1;
                  VTempImageENVect.IEBitmap.Assign( VCastVect.IEBitmap );
                  VTempImageENVect.Layers[ 1 ].PosX := 0;
                  VTempImageENVect.Layers[ 1 ].PosY := 0;
                  VTempImageENVect.Layers[ 1 ].Width := VCastVect.IEBitmap.Width;
                  VTempImageENVect.Layers[ 1 ].Height := VCastVect.IEBitmap.Height;
                  VTempImageEnVect.LayersMergeAll(True);
                  VTempImageEnVect.Update;



Also, I noticed that TImageEnVect.IEBitmap.CopyToBitmap ony takes a TBitmap. How do I copy a TIEBitmap to another TIEBitmap?

Thanks very much Nigel.

Andy

xequte Posted - Mar 09 2016 : 17:08:54
Hi Andy

Layers use a TIEBitmap, so you don't need to reference vclBitmap:

ImageEnVect1.Layers[ 1 ].Bitmap.Assign( aBitmap.vclBitmap );
->
ImageEnVect1.Layers[ 1 ].Bitmap.Assign( aBitmap );

The alpha channel should be assigned when using:

DestIEBmp.Assign( SrcIEBmp );

What code are you using?


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
AndyColmes Posted - Mar 09 2016 : 04:19:39
Hi Nigel, thank you for the tip. I will make the changes and report back.

Just to confirm, Layers are still using TBitmap instead of TIEBitmap?

Also, I would like to assign another TIEBitmap that has alpha transparent background to this layer but somehow it does not take the alpha background. I had to save this TIEBitmap to file (png) first, load it and then assign it to the layer.

Thanks again.

Andy
xequte Posted - Mar 07 2016 : 19:22:22
Hi Andy

I couldn't reproduce that using a 100 megapixel image, and also the roast beef TIFF you sent using this code:

  aBitmap := TIEBitmap.Create( 'D:\250_MB_TIFF.tif'); // 'd:\Testing_Multimedia\Big_Big_Pix\10000x10000.jpg'

  ImageEnVect1.LayersAdd;
  ImageEnVect1.LayersCurrent := 0;
  ImageEnVect1.IO.LoadFromFile( 'd:\250_MB_TIFF.tif' );
  ImageEnVect1.LayersCurrent := 1;
  ImageEnVect1.Layers[ 1 ].Bitmap.Assign( aBitmap.vclBitmap );
  ImageEnVect1.Layers[ 1 ].Transparency := 150;
  ImageEnVect1.Update;
  ImageEnVect1.LayersMerge;

  aBitmap.free;


But there may be a lot of memory in use here, so a low memory system might struggle.

Also, have you disabled LegacyBitmap?

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
AndyColmes Posted - Mar 07 2016 : 11:51:36
Hi Bill, thank you for the response. The funny thing is that it works for all images that are smaller and just not with larger images like 5000 pixels wide. It looks more like a memory issue somewhere.

Andy
w2m Posted - Mar 06 2016 : 07:53:41
This may be the problem:
A3Stream.Position := 0;
VTempImageENVect.LayersCurrent := 0;
VTempImageEnVect.IO.LoadFromStream(A3Stream);

You should always set the memory stream position to 0 before loading the stream.

or maybe this:
var
  iLayer: integer;
begin 
  VTempImageENVect.LayersCurrent := 0;
  A3Stream.Position := 0;
  VTempImageEnVect.IO.LoadFromStream(A3Stream);
  iLayer := VTempImageENVect.LayersAdd;
  VTempImageEnVect.LayersCurrent := iLayer;
  VTempImageENVect.Layers[iLayer].Bitmap.Assign(VTempMaster.Bitmap);
  VTempImageEnVect.Layers[iLayer].Transparency := 150;
  VTempImageEnVect.Update;
  VTempImageEnVect.LayersMerge;
end; 

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