回复 30楼 mywisdom88
他上传的 我测试了 是会颠倒过来的
VFP 9.0 版会颠倒过来的。
还要设置两个环境变量和参数。
直接运行示例中的 颠倒报表.prg 文件。
** ** 报表扩展功能示例(旋转) ** CREATE CURSOR tt (ss C(10), ff I) FOR i = 1 TO 10 INSERT INTO tt VALUES (PADL(i, 10, "0"), i) ENDFOR oRL = CREATEOBJECT("myReportListener") oRL.ListenerType = 1 REPORT FORM 报表扩展功能示例(旋转).frx OBJECT oRL DEFINE CLASS myReportListener AS ReportListener DynamicLineHeight = .F. IsRotate = .F. PROCEDURE Init DECLARE LONG GdipRotateWorldTransform IN GDIPlus.Dll LONG, SINGLE, LONG DECLARE LONG GdipTranslateWorldTransform IN GDIPlus.Dll LONG, SINGLE, SINGLE, LONG DECLARE LONG GdipSaveGraphics IN GDIPlus.DLL LONG, LONG@ DECLARE LONG GdipRestoreGraphics IN GDIPlus.DLL LONG, LONG ENDPROC PROCEDURE BeforeBand(nBandObjCode, nFRXRecNo) DODEFAULT(nBandObjCode, nFRXRecNo) this.IsRotate = INLIST(nBandObjCode, 1, 4, 7) && 标头、细节、注脚 ENDPROC PROCEDURE AfterBand(nBandObjCode, nFRXRecNo) this.IsRotate = .F. DODEFAULT(nBandObjCode, nFRXRecNo) ENDPROC PROCEDURE Render(nFRXRecNo, nLeft, nTop, nWidth, nHeight,; nObjectContinuationType, cContentsToBeRendered, GDIPlusImage) LOCAL gState, x, y gState = 0 IF this.IsRotate x = nLeft + nWidth && 转点 y = nTop GdipSaveGraphics(this.GDIPlusGraphics, @gState) GdipTranslateWorldTransform(this.GDIPlusGraphics, x, y, 0) GdipRotateWorldTransform (this.GDIPlusGraphics, -180, 0) && 逆转180度 GdipTranslateWorldTransform(this.GDIPlusGraphics, -x, -y, 0) ENDIF DODEFAULT(nFRXRecNo, nLeft, nTop, nWidth, nHeight, ; nObjectContinuationType, cContentsToBeRendered, GDIPlusImage) IF this.IsRotate GdipRestoreGraphics(this.GDIPlusGraphics, gState) ENDIF NODEFAULT ENDPROC ENDDEFINE