During the conversion of a program in the new version 9, I have noticed that GRAPHIC SCALE (with coordinates that grow downward), turns upside-down the drawings if the custom world coordinates are equal to the client area of the graphic control (see the sample code below).
I know that this setting is formally wrong because the client area limits go from 0 to the maximum size decreased of 1, but this behavior could perhaps create some problem to other users. This doesn't occur with the previous versions of the compiler.
Any suggestions?
bye
Sergio
I know that this setting is formally wrong because the client area limits go from 0 to the maximum size decreased of 1, but this behavior could perhaps create some problem to other users. This doesn't occur with the previous versions of the compiler.
Code:
#COMPILER PBWIN 9 #COMPILE EXE #DIM ALL GLOBAL hDlg AS DWORD GLOBAL grfId AS LONG SUB DrawFrame() LOCAL hFnt, w, h AS LONG CONTROL GET CLIENT hDlg, grfId TO w, h GRAPHIC ATTACH hDlg, grfId, REDRAW GRAPHIC CLEAR %WHITE GRAPHIC SCALE (0, h) - (w, 0) ' GRAPHIC SCALE (0, h-1) - (w-1, 0) ' this works fine... FONT NEW "Arial",18, 1 TO hFnt GRAPHIC SET FONT hFnt GRAPHIC LINE (10, 10) - (w*0.9, 10), %RED GRAPHIC LINE (10, 10) - (10, h*0.9), %RED GRAPHIC LINE (10, 10) - (w*0.9, h*0.9), %BLUE GRAPHIC COLOR %BLACK, %WHITE GRAPHIC SET POS (10,h*0.9) GRAPHIC PRINT "UP" GRAPHIC REDRAW END SUB '------------------------------------------------------------------ CALLBACK FUNCTION DlgProc () AS LONG SELECT CASE CB.MSG CASE %WM_INITDIALOG CASE %WM_COMMAND IF CB.CTLMSG = %BN_CLICKED THEN SELECT CASE CB.CTL CASE %IDCANCEL DIALOG END CB.HNDL END SELECT END IF END SELECT END FUNCTION '------------------------------------------------------------------ FUNCTION PBMAIN () AS LONG LOCAL w, h AS LONG w = 500 h = 500 DIALOG NEW PIXELS, 0, "Graphic test",,, w, h, %WS_CAPTION OR %WS_SYSMENU, 0 TO hDlg CONTROL ADD GRAPHIC, hDlg, grfId, "", 0, 0, w, h DrawFrame DIALOG SHOW MODAL hDlg, CALL DlgProc END FUNCTION
bye
Sergio
Comment