In This Topic
Sets the fill mode of a highlighted region specified by its unique identifier related to the document currently displayed in the GdViewer control. These regions, if present, determines the currently defined highlighted regions on the displayed document.
The foreground mix mode is used to combine the region fill color and the displayed area of the image covered by this region when highlighting. You can define this parameter of each highlighted region when adding regions using the AddRegion(String,Double,Double,Double,Double,Color,RegionFillMode) method. You can determine this parameter of each highlighted region using the GetRegionFillMode method.
Syntax
Parameters
- RegionID
- A unique region identifier of the specified region. You can obtain this identifier using the GetRegionID method or when creating regions using the AddRegion(String,Double,Double,Double,Double,Color,RegionFillMode) method.
- FillMode
- A member of the RegionFillMode enumeration. The new value of the fill mode to be used.
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
We strongly recommend always checking this status first.
Example
How to reset the fill mode parameter of a highlighted region.
'We assume that the GdViewer1 control has been properly integrated and your document has been properly displayed as well.
'To successfully follow this example, please use the code snippet attached to the AddRegion method to define highlighted regions
'or define some highlighted regions using SearchText methods by yourself.
Dim regID As Integer = 0, regCount As Integer = GdViewer1.RegionCount()
If regCount > 0 Then
Dim firstMode As GdPicture14.WPF.GdViewer.RegionFillMode = GdViewer1.GetRegionFillMode(GdViewer1.GetRegionID(0))
Dim currMode As GdPicture14.WPF.GdViewer.RegionFillMode = GdPicture14.WPF.GdViewer.RegionFillMode.Unknown
Dim newMode As GdPicture14.WPF.GdViewer.RegionFillMode = GdPicture14.WPF.GdViewer.RegionFillMode.Negative
For j As Integer = 0 To regCount-1
regID = GdViewer1.GetRegionID(j)
currMode = GdViewer1.GetRegionFillMode(regID)
If currMode = firstMode Then GdViewer1.SetRegionFillMode(regID, newMode)
Next
'Redrawing regions with the newly defined fill mode parameter.
GdViewer1.Redraw()
Else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetRegionFillMode")
End If
//We assume that the GdViewer1 control has been properly integrated and your document has been properly displayed as well.
//To successfully follow this example, please use the code snippet attached to AddRegion or AddRegionInches method
//to define highlighted regions or define some highlighted regions using SearchText methods by yourself.
int regID = 0, regCount = GdViewer1.RegionCount();
if (regCount > 0)
{
GdPicture14.WPF.GdViewer.RegionFillMode firstMode = GdViewer1.GetRegionFillMode(GdViewer1.GetRegionID(0));
GdPicture14.WPF.GdViewer.RegionFillMode currMode = GdPicture14.WPF.GdViewer.RegionFillMode.Unknown;
GdPicture14.WPF.GdViewer.RegionFillMode newMode = GdPicture14.WPF.GdViewer.RegionFillMode.Negative;
for (int j = 0; j < regCount; j++)
{
regID = GdViewer1.GetRegionID(j);
currMode = GdViewer1.GetRegionFillMode(regID);
if (currMode == firstMode)
GdViewer1.SetRegionFillMode(regID, newMode);
}
//Redrawing regions with the newly defined fill mode parameter.
GdViewer1.Redraw();
}
else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetRegionFillMode");
Example
How to reset the fill mode parameter of a highlighted region.
'We assume that the GdViewer1 control has been properly integrated and your document has been properly displayed as well.
'To successfully follow this example, please use the code snippet attached to the AddRegion method to define highlighted regions
'or define some highlighted regions using SearchText methods by yourself.
Dim regID As Integer = 0, regCount As Integer = GdViewer1.RegionCount()
If regCount > 0 Then
Dim firstMode As GdPicture14.WPF.GdViewer.RegionFillMode = GdViewer1.GetRegionFillMode(GdViewer1.GetRegionID(0))
Dim currMode As GdPicture14.WPF.GdViewer.RegionFillMode = GdPicture14.WPF.GdViewer.RegionFillMode.Unknown
Dim newMode As GdPicture14.WPF.GdViewer.RegionFillMode = GdPicture14.WPF.GdViewer.RegionFillMode.Negative
For j As Integer = 0 To regCount-1
regID = GdViewer1.GetRegionID(j)
currMode = GdViewer1.GetRegionFillMode(regID)
If currMode = firstMode Then GdViewer1.SetRegionFillMode(regID, newMode)
Next
'Redrawing regions with the newly defined fill mode parameter.
GdViewer1.Redraw()
Else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetRegionFillMode")
End If
//We assume that the GdViewer1 control has been properly integrated and your document has been properly displayed as well.
//To successfully follow this example, please use the code snippet attached to AddRegion or AddRegionInches method
//to define highlighted regions or define some highlighted regions using SearchText methods by yourself.
int regID = 0, regCount = GdViewer1.RegionCount();
if (regCount > 0)
{
GdPicture14.WPF.GdViewer.RegionFillMode firstMode = GdViewer1.GetRegionFillMode(GdViewer1.GetRegionID(0));
GdPicture14.WPF.GdViewer.RegionFillMode currMode = GdPicture14.WPF.GdViewer.RegionFillMode.Unknown;
GdPicture14.WPF.GdViewer.RegionFillMode newMode = GdPicture14.WPF.GdViewer.RegionFillMode.Negative;
for (int j = 0; j < regCount; j++)
{
regID = GdViewer1.GetRegionID(j);
currMode = GdViewer1.GetRegionFillMode(regID);
if (currMode == firstMode)
GdViewer1.SetRegionFillMode(regID, newMode);
}
//Redrawing regions with the newly defined fill mode parameter.
GdViewer1.Redraw();
}
else
MessageBox.Show("No highlighted region found related to this document. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetRegionFillMode");
See Also
Reference
GdViewer Class
GdViewer Members
AddRegion(String,Double,Double,Double,Double,Color,RegionFillMode) Method
GetRegionFillMode Method
GetRegionID Method
AddRegion(String,Double,Double,Double,Double,Color,RegionFillMode) Method
GetRegionFillMode Method
RegionCount Method
GetRegionID Method
SearchText(String,Int32,Boolean) Method
SearchText(String,Int32,Boolean,Boolean) Method
AddRegion(String,Double,Double,Double,Double,Color,RegionFillMode) Method