Hello,
About creating a region and save it, the details depend on the programming interface (COM, API, OCX, etc.) that you use. What is the programming interface?
For example, if you are using LEADTOOLS COM programming interface, you can do it by using the following code:
+--------------------------------------+
Dim RasterIO As New LEADRasterIO
Dim X, Y, W, H As Integer
Dim RasterProc As New LEADRasterProcess
'The dimensions of the region
X = 50
Y = 50
W = 100
H = 100
'Load the image
RasterIO.Load LEADRasterView1.Raster, "c:\1.bmp", 0, 0, 1
'Set the type of the region frames
LEADRasterView1.RgnFrameType = RGNFRAME_ANIMATED
LEADRasterView2.RgnFrameType = RGNFRAME_ANIMATED
'Add region to the image
LEADRasterView1.Raster.SetRgnEllipse X, Y, W, H, L_RGN_SET
'Create a bitmap with the same dimentions of the region that you want to save
LEADRasterView2.Raster.CreateBitmap W, H, LEADRasterView1.Raster.BitmapBits
'Fill the created image
RasterProc.Fill LEADRasterView2.Raster, RGB(255, 255, 255) ' fill with white
'Combine the two images
RasterProc.CombineExt LEADRasterView2.Raster, 0, 0, W, H, LEADRasterView1.Raster, X, Y, CB_OP_ADD And CB_DST_0
'Save the new image
RasterIO.Save LEADRasterView2.Raster, "c:\test.bmp", FILE_BMP, LEADRasterView2.Raster.BitmapBits, 0, SAVE_OVERWRITE
+--------------------------------------+
About using LEADTOOLS functions with the region, do you mean that you want to use the functions with the region or with the new created image?
However, some functions are working with regions, such as RasterProc.Fill method. And some other functions apply to the entire image (regardless of the region) such as the RasterProc.Grayscale method. But since you created a new image from the region, you can use the different functions with the image with no problem.
Thanks,
Maen Badwan
LEADTOOLS Technical Support