Spread Windows Forms 17
In This Topic
    Picture Adjustment
    In This Topic

    You can customize an image in the worksheet by adding various artistic effects. This way predefined effect can transform any image into a sketch or a painting. The PictureEffectType enum from Spread WinForms supports the following customization options:

    The following image shows the original image [Left image] and image with picture effects set as Blur and FlimGrain [Right image].

     pictureadjustment

    Using Code

    C#
    Copy Code
    IWorksheet TestActiveSheet = fpSpread1.AsWorkbook().ActiveSheet;
    GrapeCity.Spreadsheet.Drawing.IShape picture1 = TestActiveSheet.Shapes.AddPicture(@"D:\spread.png", true, true, 40, 20, 200, 150);
    GrapeCity.Spreadsheet.Drawing.IShape picture2 = TestActiveSheet.Shapes.AddPicture(@"D:\spread.png", true, true, 300, 20, 200, 150);
    GrapeCity.Spreadsheet.Drawing.IPictureEffects pic = picture2.Fill.PictureEffects;
    GrapeCity.Spreadsheet.Drawing.IPictureEffect pics1 = pic.Insert(GrapeCity.Spreadsheet.Drawing.PictureEffectType.Blur);
    GrapeCity.Spreadsheet.Drawing.IPictureEffect pics2 = pic.Insert(GrapeCity.Spreadsheet.Drawing.PictureEffectType.FilmGrain);
    
    VB
    Copy Code
    Dim TestActiveSheet As IWorksheet = FpSpread1.AsWorkbook().ActiveSheet
    Dim picture1 As GrapeCity.Spreadsheet.Drawing.IShape = TestActiveSheet.Shapes.AddPicture("D:\spread.png", True, True, 40, 20, 200, 150)
    Dim picture2 As GrapeCity.Spreadsheet.Drawing.IShape = TestActiveSheet.Shapes.AddPicture("D:\spread.png", True, True, 300, 20, 200, 150)
    Dim pic As GrapeCity.Spreadsheet.Drawing.IPictureEffects = picture2.Fill.PictureEffects
    Dim pics1 As GrapeCity.Spreadsheet.Drawing.IPictureEffect = pic.Insert(GrapeCity.Spreadsheet.Drawing.PictureEffectType.Blur)
    Dim pics2 As GrapeCity.Spreadsheet.Drawing.IPictureEffect = pic.Insert(GrapeCity.Spreadsheet.Drawing.PictureEffectType.FilmGrain)
    

    Limitations

    Spread for WinForms only supports the listed picture effects.