我是一个函数中,大致如下思路设计:
adoRs1.CursorLocation = ADODB.CursorLocationEnum.adUseClient
adoRs1.Open(PageSQLStr_Sum, cnn3, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
With C1FlexGridClassic1
da.Fill(ds, adoRs1, "mflinfo")
.DataSource = ds.Tables("mflinfo")
.set_Cell(C1.Win.C1FlexGrid.Classic.CellPropertySettings.flexcpPictureAlignment, 1, Colimage, .Rows - 1, Colimage, C1.Win.C1FlexGrid.Classic.PictureAlignmentSettings.flexPicAlignStretch)
image2 = New System.Drawing.Bitmap(200, 200) '定义新图尺寸
Grp = System.Drawing.Graphics.FromImage(image2) '定义面板
Grp.DrawImage(image, New System.Drawing.Rectangle(tmpX, tmpY, tmpW, tmpH), New System.Drawing.Rectangle(0, 0, image.Width, image.Height), System.Drawing.GraphicsUnit.Pixel) '画新尺寸图(原图,缩放到新图的指定区域,读取原图的指定区域)
.SetCellImage(i, Colimage, image2) '表格中显示图
End With |