From: richard.townsendrose on
Hi all

I am prettty hopeless with images and dibs and so on and rely on
Fabrice's stuff - indeed i have just upgraded FabPaint stuff to
version 3.01.1.5 of 9th september 2008.

Everything that was working STILL works .. GREAT

I mean
SELF:oDCFabSig:Image := FabPaintlib { cFileName , SELF }
is just so simple !

But i was hoping to be able to use his
FUNCTION FabWriteDIB2BMPFile( hDIB AS PTR, cFileName AS STRING ) AS
LOGIC

I have been saving displayed dibs as jpegs, and we routinely store
these into a jpeg, and read them back into an ADS memofield. and then
print them in reportpro via creating a jpeg image on disk.

Now all I want to do is save one as a BitMap. But the function
prpoduces a dmaaged bitmap which topples ReportPro over the edge -
its actually a LightLib dll that falls over trying to display the
image ... which is somewhat OUCH ... nothing else can display the
knackered bitmap either ...

I dont want to have to change every single one of our reports to use a
jpeg for a logo, let alone mess with every users's bespoked
reports ... i wont [nor want to] live that long ...!

any ideas ...

richard
From: John Martens on
I'm using these:

_DLL FUNCTION DIBSaveAs(pWinBmp AS PTR, pszFName AS PSZ) AS VOID
PASCAL:FabPaint.FabDIBSaveAs
//p Save a DIB Object to a DIB file
//a <pWinBMp> Pointer to the DIB Object to save
//a <pszFName> Name of the File to create
//d This function will save the desired DIB Object as a DIB file.

_DLL FUNCTION DIBSaveAsPNG(pWinBmp AS PTR, pszFName AS PSZ) AS VOID
PASCAL:FabPaint.FabDIBSaveAsPNG
//p Save a DIB Object to a PNG file
//a <pWinBMp> Pointer to the DIB Object to save
//a <pszFName> Name of the File to create
//d This function will save the desired DIB Object as a PNG file.

First one for BMP, second for PNG, works fine for me

John



Op 22-6-2010 16:34, richard.townsendrose schreef:
> Hi all
>
> I am prettty hopeless with images and dibs and so on and rely on
> Fabrice's stuff - indeed i have just upgraded FabPaint stuff to
> version 3.01.1.5 of 9th september 2008.
>
> Everything that was working STILL works .. GREAT
>
> I mean
> SELF:oDCFabSig:Image := FabPaintlib { cFileName , SELF }
> is just so simple !
>
> But i was hoping to be able to use his
> FUNCTION FabWriteDIB2BMPFile( hDIB AS PTR, cFileName AS STRING ) AS
> LOGIC
>
> I have been saving displayed dibs as jpegs, and we routinely store
> these into a jpeg, and read them back into an ADS memofield. and then
> print them in reportpro via creating a jpeg image on disk.
>
> Now all I want to do is save one as a BitMap. But the function
> prpoduces a dmaaged bitmap which topples ReportPro over the edge -
> its actually a LightLib dll that falls over trying to display the
> image ... which is somewhat OUCH ... nothing else can display the
> knackered bitmap either ...
>
> I dont want to have to change every single one of our reports to use a
> jpeg for a logo, let alone mess with every users's bespoked
> reports ... i wont [nor want to] live that long ...!
>
> any ideas ...
>
> richard
From: richard.townsendrose on
John

thanks

brilliant ... this is the clue ...

_DLL FUNCTION DIBSaveAs(pWinBmp AS PTR, pszFName AS PSZ) AS VOID
PASCAL:FabPaint.FabDIBSaveAs

it appears that the Declaration MUST be in the same library where the
call is made from. The VO one is in 2.8GUI and one does rather need
that !

as without it then it calls the vo2.8 one which i guess is not
linked ...

richard
From: Sherlock on
I found this info in a previous post and it works and I do not need to
create BMP anymore and can pring JPGS on the fly.

cFileJPG := SELF:cPathImages + SELF:oasServer:FIELDGET(#IMGNAME)
IF File( cFileJPG )
oDib := FabPaintLib{ cFileJPG , oPrinter }
IF oDib:Isvalid
oPrinter:_DrawBMP( x, y, oDib, nImageWidth, nImageHeight,,,
TRUE )
ELSE
oPrinter:TextOut( x, y, 'JPG load fail')
ENDIF
ELSE
// Its missing !
ENDIF

Add this to FABPAINT LIB 3.0.15

METHOD DrawDIB( hDC, x, y, h, w ) CLASS FabPaintLib
SELF:StretchDrawDC( hDC, y, x, w, h )
//p Stretch the image in a Window
//a <hDC> Handle of the Device Context
//a <x> X Pos of the image in the window.
//a <y> Y Pos of the image in the window.
//a <w> Width of the area for displaying the DIB.
//a <h> Height of the area for displaying the DIB.
RETURN SELF

I wrote to Fabrice to add this method in future builds of of Fabpaint
library

Phil McGuinness

From: richard.townsendrose on
Phil

as i have been corresonding with fabrice about having a student [aka
unpaid slave] of his again for 6 weeks ... i mentioned it to him, and
he vame back with the obvious

as my image on screen is a fabpaintlib object
SELF:oDCFabSig:Image := FabPaintlib { cFileName , SELF }

all i actually needed was this
SELF:oDCFabSig:Image:SaveAs(cFile)

Quote_fabrice
Ok, so in FabPaintLib class you have SaveAs() method to save in Bmp,
SaveAsJPEG(), SaveAsPNG(), and SaveAsTIFF() saves in their PostFix-
Format.
End_Quote

yes i read the manual [well readme], and pondered the demo ... but the
old ng is still the best place ...

and this was the start of todays learning ...

richard