Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, March 31, 2023 2:06:26 AM(UTC)

Noor  
Noor

Groups: Registered
Posts: 2


I have been following the solution provided in the sample https://www.leadtools.co...he-document-viewer.html, But was not able to add custom color to the annotation, Could you please help me with some sample.

Update: I am looking to draw a rectangle with custom color.(the rectangle should be filled with : Red, Green, Blue etc selected color.)

Regards,
Noor

Edited by user Tuesday, April 4, 2023 9:03:40 AM(UTC)  | Reason: Not specified

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Saturday, October 7, 2023 5:14:26 AM(UTC)
noramila

Groups: Registered
Posts: 12

Thanks: 4 times

Here is an Ex..how to do that.
Quote:
// Create a rectangle annotation
var annotation = new lt.Annotations.Engine.AnnRectangleObject();

// Set the rectangle's bounds
var bounds = new lt.LeadRectD(100, 100, 200, 150); // Modify the coordinates and size as needed
annotation.bounds = bounds;

// Set the custom fill color (e.g., Red)
var fillColor = new lt.Annotations.Engine.AnnSolidColorBrush();
fillColor.color = lt.Annotations.Engine.AnnColor.create(255, 0, 0); // Red color (R, G, B values)
annotation.fill = fillColor;

// Add the annotation to the container (viewer)
annContainer.children.add(annotation);

// Make sure to update the viewer to see the changes
viewer.invalidate(lt.LeadRectD.empty);

// Assuming 'viewer' is your LEADTOOLS viewer and 'annContainer' is your annotation container.

This is an example please adjust the size, and color values according to you...
The Doc you mention is not available So here is the update doc.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.131 seconds.