I have downloaded the new version of FabPaint (for VO 28) from
Fabrices web site but it does not seem to work the same way as thw
previous version. I have imported the AEF which displays the bBrowser
window and calls the GetImage method to display the image in the
browser. What I get is as follows:
- First image displays ok
- Second image is flipped upside down and displayed partly behind
first image
- ResizeBilinear does not seem to resize image. An image of 128 pixels
does not seem to be scaled to fit a 100 pixel wide column.
- SaveAsJPEG does not save SaveAsTiff does work.
Has anyone else come across this? Is the problem with bBrowser or
FabPaint?
Any help would be appreciated. The methods for setting up the browser
and getting the image are shown below.
Thanks in advance.
Kevin
METHOD SetupBrowser() CLASS winImageWindow
//
// Setup browser
//
LOCAL oColumn AS bDataColumn
SELF:oDCbrwBrowser:Use( SELF:oServer, {'Name'} )
// Set up virtual column
oColumn := bDataColumn{ SELF:oDCbrwBrowser,; // owner
SELF:oServer,; // Server
{|Server, arg| arg:GetImage(Server)},; // Expression
#Expression,; // symFieldMode
SELF} // argument --> Self:GetImage()
oColumn:Caption := "Photo"
oColumn:HyperLabel := HyperLabel{#PHOTO}
oColumn:ValType := "O"
oColumn:Alignment := BALIGN_CENTER
oColumn:Width := 100 // 100 pixels width
oColumn:Resizable := FALSE
SELF:oDCbrwBrowser:AddColumn( oColumn )
SELF:oDCbrwBrowser:OpenColumn( oColumn, 1 ) // make it first column
SELF:oDCbrwBrowser:RowHeight := 100
SELF:oDCbrwBrowser:Recalculate()
SELF:oDCbrwBrowser:Refresh()
RETURN NIL
METHOD GetImage( oServer ) CLASS winImageWindow
//
// Create thumbnail fr viewing
//
LOCAL oFabImage AS FabPaintLib
LOCAL cFileName AS STRING
LOCAL cThumbNailName AS STRING
LOCAL nHeight, nWidth, nNewHeight, nNewWidth AS LONG
LOCAL nMaxDim, r8Scalefactor AS REAL8
// compose thumbnail (has to be prefixed uniquely, so that other
// bBrowsers can also show images without confusing with these
thumbnails
cThumbNailName := self:cThumbDir + "PW" + NTrim(oServer:RECNO) +
'.tiff'
IF File(cThumbNailName)
// if exists it then use it
oFabImage := FabPaintLib{cThumbNailName, SELF}
ELSE
// thumbnail does not exist so create it
cFileName := AllTrim( oServer:PictPath) // Folder for images
oFabImage := FabPaintLib{ cFileName, SELF }
IF oFabImage:IsValid
nHeight := oFabImage:Height
nWidth := oFabImage:Width
nMaxDim := Max(nHeight, nWidth) // determine biggest dimension
// determine scale factor based onm size 100 pixels
r8Scalefactor := 100/nMaxDim
nNewHeight := Integer( Round( nHeight * r8Scalefactor, 0))
nNewWidth := Integer( Round( nWidth * r8Scalefactor, 0))
oFabImage:ResizeBilinear( nNewWidth, nNewHeight) // transform to
32bpp
oFabImage:SaveAsTIFF( cThumbNailName )
ENDIF
ENDIF
RETURN oFabImage
Regards,
Fabrice.
Hi,
a first quick and dirty application does the following :
ResizeBilinear works ok
SaveAsJPEG : open an image then save is ok
SaveAsJPEG : open an image, Resize then save does nothing !
Now about the upside down problem, this might be a coordinate system
problem, I will take a look at my code to see if I can do
something...not completly sure...but, will see.
Regards,
Fabrice
Keep me informed if you still have troubles with Resize.
Cheers,
Fabrice.
I'm not at that machine at the moment but will give it a try when I
can and will let you know.
Thanks for the quick response.
Kevin
On Nov 25, 9:24 pm, "nos...@fabtoys.net" <fabrice.fo...@gmail.com>
wrote:
The image file is now created as a JPEG file. The first image also
displays within the column width.
However, the next image is still displayed upside down and partly
under the first. It also appears 'streched' when you can see it.
Kevin
On Nov 25, 9:24 pm, "nos...@fabtoys.net" <fabrice.fo...@gmail.com>
wrote:
TIA,
Fabrice
>
Hi Kevin,
the code was mine (with some help of Joachim) and unfortunately I can
only confirm your findings: I've just tested with the new Fabpaint and I
have the same problem.
I've quickly debugged and the problem is the oFabimage:Isvalid which
returns False (which in its turn, seems to be because
oFabImage:CreateFromFile() is not working and not returning a valid
pointer.
I don't have time today so I will debug some more tomorrow.
PS: I've also downloaded Fabrice's demo and there I also notice some
problems. E.g. you open a big image, then you zoom it smaller. You will
then get a smaller image (all OK) but the background of the image
control stays filled with the old one (not OK).
Another problem that I see is that the support for PSD (Photoshop)
images is missing?
bye
--
Paul
>
> I've quickly debugged and the problem is the oFabimage:Isvalid which
> returns False (which in its turn, seems to be because
> oFabImage:CreateFromFile() is not working and not returning a valid
> pointer.
sorry... too hasty in my conclusion... the CreateFromFile() is not the
problem
will see tomorrow
--
Paul
Fabpaint does create the thumbnails OK on disk. Just checked. Al there
in in the correct size and rotation.
So the problem must reside in the drawing in the bBrowser.
This method did not change and always worked.
Maybe Fabrice can tell us if the ShowExDC() is behaving differently than
before?
(And now I'm leaving in a hurry, have to be in Rotterdam in 1 hour <g>)
METHOD DrawValue(oEvent) CLASS DetPag4Win
// tekent het binnengekregen FabPaintlib object in de browser ( zie ook
de GetImage methode)
LOCAL uValue AS USUAL
LOCAL srcArea AS _winRect
LOCAL oFabImage AS FabPaintLib
uValue := oEvent:Value
IF IsInstanceOfUsual(uValue, #FabPaintlib)
oFabImage := uValue
srcArea := oEvent:Area
oFabImage:ShowExDC( oEvent:DeviceContext,;
srcArea.Left,;
srcArea.Top)
ENDIF
RETURN TRUE
--
Paul
I will set one up and send it to you later, when I am back at the
machine I am testing it on. Will I send it to this address or another
one?
If I can do it in time I will rig up a program ot use runtime that
uses bBrowser so you can test it.
Kevin
On Nov 26, 7:53 pm, "nos...@fabtoys.net" <fabrice.fo...@gmail.com>
wrote:
I had forgotten whose code it was nnd it works well in V)27. Well done
for that.
When I used it in VO28 I did not know where the issue was. There was
no apparent changes neexded after recompiling it. I did not know if I
had missed omething in bBrowser 3 or in the new FabPaint.
Did you download the new version of the DLL Fabrice posted (3.0.1)? It
fixes the SaveAsjpeg issue as identified by Fabrice. Have to check to
be certain but I think the same resizing issue may be in the
SaveAstiff, I will check that later.
Thanks for the initial code.
Kevin
On Nov 27, 8:10 am, "Paul D B" <poll...@NOMORESPAMhnt.be> wrote:
The method you requested is below.
I have sene the image to the address with the subject Fabrice Image.
Kevin
On Nov 26, 7:53 pm, "nos...@fabtoys.net" <fabrice.fo...@gmail.com>
wrote:
Yes I have made the test with the new DLL. As I said the error is not in
the way Fabpaint creates the images.
As you will know my code creates thumbnail images in a temp folder, and
that are the ones that will be shown in the bBrowser. Open that folder
while the application is running and you will see that they are all
there, correctly downsized and so on.
The problem is in the drawing in the bBrowser. I've posted that code, it
is very short and has not changed. But it uses a method from Fabrice
(oFabImage:ShowExDC) and so something must have changed there.
--
Paul
Hi Paul,
yes this one, at least ;-), has changed 'cause I'm now using FreeImae
as underlying lib and no more PaintLib, so....
I will take a deeper look at it, when my OutlookBar gives me some
times.... <vbg>....no, no, just kidding !
I hope to send you a 2003-style soon
Cheers,
Fabrice.
Great Fabrice, I'm sure you will come up with something nice.
thanks a lot
--
Paul
I had got the impression, wrongly as it happened, that you may not
have picked up the new DLL and this is why I asked. Indeed I hadm
noticesd the thumbs were created in the foldwr with the new DLL.
Apologies if my post had been misunderstood.
Favrice, thanks for the good work on thia and your other utilities.
Kevin
On Nov 28, 7:52 am, "Paul D B" <poll...@NOMORESPAMhnt.be> wrote:
local oldmm as long
oldmm := SetMapMode( hDC, MM_TEXT )
DIBShowEx( hDC, ..... )
SetMapMode( hDC, oldmm )
HTH,
Fabrice
Just to let you know the suggestion did not work. I had to change hDC
to self:pDIBObject.
Kevin
On Nov 29, 10:24 pm, "nos...@fabtoys.net" <fabrice.fo...@gmail.com>
wrote:
Regards,
Fabrice.
Kevin
On Nov 30, 6:04 pm, "nos...@fabtoys.net" <fabrice.fo...@gmail.com>
wrote: