Page 1 of 1

Highlighting area of a page

Posted: Tue Nov 06, 2012 11:59 pm
by mchernecki
I have GDPicture .NET ver 7. Iam developing an app where on the left I have textboxes for the user to input data and the right is a GDViewer object to display the page. I would like to display a rectangle around an area of the page, highlighting the data corresponding to the textbox. As the user tabs through the textbox fields, I would like to move this rectangle around the page to highlight the data.

I have tried this using regions, but I found it to be unreliable and slow. Perhaps I am not calling the api in the proper order. I have the following code on the the enter event for each textbox, changing the region coordinates for each field. The first field that loads is highlighted with a black border rectangle with red text, each occurance after has no bounding rectangle and text is blue.

Should I be doing this a different way and do you have an example?

Code: Select all

 
gdViewer1.RemoveAllRegions();
gdViewer1.AddRegion("Data", 100, 300 + (397 * 0), 2200, 200, ForegroundMixMode.ForegroundMixModeUNDEFINED, Color.Blue);
gdViewer1.SetRegionBorderWidth(1, 3);
gdViewer1.SetRegionColor(1, Color.Red);
gdViewer1.Redraw();

Re: Highlighting area of a page

Posted: Thu Jan 31, 2019 3:33 pm
by Gabriela
Hi,

The SetRegionBorderWidth() method sets the property to the region with the specified RegionID:
https://www.gdpicture.com/guides/gdpicture/web ... Width.html
Perhaps you can use the Rectangle of Selection in your scenario:
https://www.gdpicture.com/guides/gdpicture/web ... ument.html