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
 Bitmap Direct Draw on Layer

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
HMArnold Posted - Jul 18 2026 : 15:32:55
What is the best way to be able to draw thousands of X marks using standard Bitmap MoveTo/LineTo commands?

I have been using multiple layers with

Image.AddNewObject(iekLine,Rect(X-Length,Y-Length,X+Length,Y+Length),Color));

The problem is that with several thousand marks, I can clear the marks without reloading the image, but it takes too long to redraw all the new layers.

I have also tried doing the marks directly on the image, which works much faster for adding new marks, but every time I want to redraw the screen for any reason, such as deleting one mark and re-drawing the rest, I have to also reload the image, which is huge and also takes time.

Is there a way to define a single layer to hold all the marks in such a way that to clear the screen I just delete that one layer and don't have to reload the full image?

I want the marks to show up on the image.

Thanks in advance

HM Arnold
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 28 2026 : 23:27:39
Sorry, I mean that you should store a bitmap (or an array of bitmaps) in your unit of the previous state(s) so you can quickly revert back to them.


Nigel
Xequte Software
www.imageen.com
HMArnold Posted - Jul 23 2026 : 06:45:12
Thanks for the response.

Cacheing the image then dropping it back in view sounds promising.

I find example of how to control cache options, but not an example of how to use it.

Is there a demo that shows how to cache and image, then bring it back?

Thanks

HM Arnold
xequte Posted - Jul 20 2026 : 02:06:00
Hi

Firstly, please note that your code is not using Layers but (legacy) TImageEnVect objects.

https://www.imageen.com/help/TImageEnVect_vs_TIELayers.html


I think thousands of line objects (or layers) will give you performance issues, so I think using a bitmap is a better option. You could cache some bitmaps to provide some performance tweaks (e.g. storing the previous bitmap, if they want to delete the last point).

Other possible options (requires using layers):

- Custom drawing of the layer containing all points. See demo:
LayerEditing\Layers_CustomDraw\LayersDraw.dpr

- Using a TIEPolyline layer and adding your lines separated by break points

e.g.
AddPoint( 500, 500 );
AddPoint( 600, 500 );
AddPoint($FFFFF, $FFFFF); // Break
AddPoint( 580, 500 );
AddPoint( 400, 580 );
AddPoint($FFFFF, $FFFFF); // Break
AddPoint( 20, 35);
AddPoint( 120, 135);
AddPoint($FFFFF, $FFFFF); // Break

http://www.imageen.com/help/TIEPolylineLayer.AddPoint.html

Nigel
Xequte Software
www.imageen.com