PDA

View Full Version : Moving from 2.6 to 3.0



raveens
30-Dec-2019, 04:11 PM
Hi DAW,

Is there a compiler variable/check between graphics library 2.6 and 3.0 ?

Currently the only feasible one is to use the "GDI_ERROR" definition.




#IFDEF GDI_ERROR
// 3.0
#ELSE
// 2.6
#ENDIF



The following would be nice:
#REPLACE GRAPHIC_LIB_VERSION |CI3
#REPLACE GRAPHIC_LIB_REVISION |CI0

The reason for this is because 3.0 is not fully compatible with 2.6, for starters:
1. ppImage has been changed to paImage (was a pointer but now is an address)
2. CreateImageFromStream does not exists anymore, replaced with a better CreateImageFromUCharArray

Thanks

Vincent Oorsprong
30-Dec-2019, 10:22 PM
Raveen,

The library 3.0 is the only library version supported with version 19.1. This means that a check is not really needed. You cannot/should not try to use the library of an older version with DataFlex 19.1 and vice versa.

raveens
30-Dec-2019, 10:34 PM
Hi Vincent,


Yes! Its only being used/tested in DF19.1... BUT, we have common/shared classes (i.e cThumbImageContainer.pkg subclass of cImageContainer) and I really don't want to be maintaining 2-3 sets of classes for 2.6 and 3.0

Our common/shared (ie cThumbImageContainer) classes are used in our DataFlex applications ranging from:
1. DataFlex 18.2 via Graphics Lib 2.6
2. DataFlex 19.0 via Graphics Lib 2.6
3. DataFlex 19.1 via Graphics Lib 3.0 (was 2.6)

Hence, I asked for a compiler variable.

FYI - for now we are using the GDI_ERROR

Below is an example of how we are using (within the cThumbImageContainer.pkg) :



...
// Create brush for drawing
Get Create (RefClass(cGDISolidBrush)) to hoBrush
#IFDEF GDI_ERROR
// Graphic Lib 3.0
Get ARGB of ghoGDIPlusHandler 255 (R_From_RGB(clWhite)) (G_From_RGB(clWhite)) (B_From_RGB(clWhite)) to iColor
#ELSE
// Graphic Lib 2.6
Move (ARGB (255 , R_From_RGB (clWhite), G_From_RGB (clWhite), B_From_RGB (clWhite))) to iColor // white brush, with alpha channel to full
#ENDIF
Get CreateSolidFill of hoBrush iColor to iResult
If (iResult=gpOk) Begin
// Fill Graphics
Get FillRectangle of hoGraphics hoBrush 0 0 iThumbnailSize iThumbnailSize to iResult
End
...


I hope this makes sense

Michael Mullan
1-Jan-2020, 03:32 PM
CreateImageFromStream does not exists anymore, replaced with a better CreateImageFromUCharArray

How is this 'Better' ?

I have an Image Processing DLL that returns a stream object and I'm not sure how this may change for the 3.0 Version.

MM