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
 Stop Layers from redrawing if cache is on

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
zerob Posted - Aug 27 2024 : 04:22:39
Hi Nigel
I've enabled LayerCaching (LayersCaching := -1;) and fastdrawing (LayersFastDrawing := iefDelayed;) and created some alpha bitmap layers.
Each time i click on a layer, an empty space or move a layer or resize one of the layers and so on, all layers start to look jaggy again and need redrawing.
Is there a way to use the pretty layers from cache instead of resmoothing them over and over until i actually alter a particulary layer and then just that layer needs to resmoothe to look pretty again?
If i not touch other layers, or even the actual layer only gets moved, resmoothing isn't needed if a cached version already exists and also other layers don't need to be repainted at all if they don't overlap (or repainted from cache).

This would be really nice and maybe even speed up non iefDelayed drawing / moving a lot.

Regards
7   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 02 2024 : 19:20:38
Thank you for the concise steps to reproduce. I have emailed you the latest beta which should resolve it.

Please email us directly if you encounter beta related issues.

Nigel
Xequte Software
www.imageen.com
zerob Posted - Sep 02 2024 : 02:18:54
I've found the culprid.
I wanted to see the Chessboard background (because i load alpha layers) and if i do hide your 0 layer, then it won't smooth the layers anymore and also in your demo, moving the layer gets painfully slow after hiding the background (even without adding chessboards).

Backgroundstyle = iebsChessboard // not required, also happens without
ImageEnView1.Layers[0].Visible := False;
ImageEnView1.Layers[0].SetBounds(0,0,ImageEnView1.Width,ImageEnView1.Height); // this was a leftover before i tried to hide the background... see below comment.

While digging deeper, i've found that i still had left some resizing code of the Layer 0 in the form creation and the form resize.

ImageEnView1.Layers[0].SetBounds(0,0,ImageEnView1.Width,ImageEnView1.Height);
It seems that resizing that hidden background layer or even doing a FormResize with

ImageEnView1.Layers[0].Bitmap.Resize(ImageEnView1.Width,ImageEnView1.Height,clRed);
ImageEnView1.Layers[0].Width := ImageEnView1.Width;
ImageEnView1.Layers[0].Height := ImageEnView1.Height;

Causes this.
I can uncomment either or both and get this result.
It seems the caching algorythm doesn't like a resized, hidden layer 0.

But when i remove this, the result of your changes are impressive.
This does make ImageEn so much better in many situations.
Really good work!
xequte Posted - Sep 01 2024 : 16:16:32
Hi

I've created a simple demo using your code above, but cannot reproduce the issue. Can you please test it and let me know what changes I need to make to reproduce it.

www.ImageEn.com/temp/Zerobtest.zip

Nigel
Xequte Software
www.imageen.com
zerob Posted - Aug 31 2024 : 09:11:05
After installing the latest Beta, the Layers stopped smoothing at all and seem to always look jaggy, no matter what i do.

ImageEnView1.LayersCaching := -1;
ImageEnView1.LayersRotationFilter := TIEAntialiasMode.ierBicubic;
ImageEnView1.LayersRotationUseFilterOnPreview := True;
ImageEnView1.LayersRotationAntialias := True;
ImageEnView1.LayersFastDrawing := TIEFastDrawing.iefDelayed; // also tried normal
ImageEnView1.ZoomFilter := TResampleFilter.rfLanczos3;
ImageEnView1.DelayZoomFilter := True; // also tried False
ImageEnView1.Zoom := 100;
xequte Posted - Aug 28 2024 : 23:58:43
Hi

Please email me for the latest beta that supports this.

Nigel
Xequte Software
www.imageen.com
zerob Posted - Aug 28 2024 : 03:33:09
Hmm, it seems, the whole thing isn't comming from the FastDrawing, but from the ZoomFilter.
Even if i didn't change the ImageEnView1.Zoom and it is still at 100.
If i set DelayZoomFilter to False, then all movement etc stutters because i've set the ZoomFilter to rfLanczos3.
If i set it to rfNone then the Layers look jaggy.
Is it also considered Zooming when i resize a Layer with "Layers[0].SetBounds(0,0,343,343);" when the image that i loaded with "LayersAdd('...');" was initially larger than 343?
Can this smoothing be cached somehow? Would be nice if i didn't have to resample the images to a low quality and back and forth.
xequte Posted - Aug 28 2024 : 00:33:12
Hi

Why not just use:

ImageEnView1.LayersFastDrawing := iefNormal;

http://www.imageen.com/help/TImageEnView.LayersFastDrawing.html

Nigel
Xequte Software
www.imageen.com