FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Missing images in xBrowse
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Missing images in xBrowse
Posted: Thu Nov 07, 2019 03:07 PM
Hello,

I want to list all created bmp's from a defined directory
I noticed all normal Bmp's are visible but not the created ones.
The images are OK because they are visible at the bottom on
xBrowse row-selection



saved like

oBmp1:SaveToBmp( c_path2 + "Img64_" + ALLTRIM(STR(nCount[1])) + ".bmp" )

in xBrowse

WITH OBJECT:aCols[ 1 ]
:cDataType := 'F'
:nDataBmpAlign := AL_CENTER
:lBmpTransparent := .f.
//:lBmpTransparent := .t.
END

some of the created Bmp's









any idea

regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: Missing images in xBrowse
Posted: Thu Nov 07, 2019 08:26 PM

Maybe if you increase the row height of the xbrowse?

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Missing images in xBrowse
Posted: Thu Nov 07, 2019 09:01 PM

The row-height is defined with 65 pixel
to show a image with the max size of 64x64.
It is funny that only the saved images are not visible.
I can copy any other image to the directory
like shown in the screenshot from above and it works.

I think I will create a working test to show the effect

regards
Uwe :(

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Missing images in xBrowse
Posted: Fri Nov 08, 2019 06:55 AM

We do not know your xbrowse code.
We also do not know if the bitmaps created are valid bitmaps.
We can advise if you provide a self contained sample program.

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Missing images in xBrowse
Posted: Fri Nov 08, 2019 08:53 AM
I think I found what happens :-)

We also do not know if the bitmaps created are valid bitmaps.

1. I did a screenshot

ACTIVATE WINDOW oWnd ;
ON RIGHT CLICK oWnd:SaveToBmp( "test.bmp" )


2. using < PIXELFORMER > the problem is visible.
The filemanager is showing the normal bmp. :-)
Loading the file I'm getting a funny result, everything is transparent.
We do not know your xbrowse code.

That is the reason xBrowse doesn't show the created bmp



The same happens using another freeware < xNView >
Again a different result.
Now the filemanager and editor are showing < Test.bmp > as a transparent image





maybe another solution instead of using :SaveToBmp ?
I tested :
hBmp := FW_MakeYourBitmap( 64, 64, { |hDC,w,h| GradientFill( hDC, 0, 0, h, w, ;
{{ 1, aColors[2] , aColors[4] }} ) } )
FW_SaveImage( hBmp, AllTrim( c_path2 + "Img64_" + ALLTRIM(STR(nCount[1])) + ".bmp" ) )

but the same result created but not visible in xBrowse :-)

3. using a professional program < COREL Paintshop Pro >.
The filemanager and editor are showing the normal bmp. :-)
There must be something wrong with the file-format

the created oWnd:SaveToBmp( "test.bmp" )



another test
loaded and saved again with a new name without any changes
now it works



regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Missing images in xBrowse
Posted: Thu Nov 14, 2019 09:23 AM
I changed to xImage and added a export-format-option.
A created JPG is ok, a BMP is not visible





is there any solution for BMP's

regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Missing images in xBrowse
Posted: Thu Nov 14, 2019 09:34 AM

You may get this problem in case of bitmaps with only 2 colors.

Please try
oCol:lBmpTransparent := .F.

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Missing images in xBrowse
Posted: Thu Nov 14, 2019 09:44 AM
You may get this problem in case of bitmaps with only 2 colors.


I tested with a screenshot ( many colors ) and got the same result
it seems to be somethig wrong with the BMP-format

The BMP is created but not visible in xbrowse



regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Missing images in xBrowse
Posted: Thu Nov 14, 2019 09:46 AM

Can you send me the bitmaps to my email?

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Missing images in xBrowse
Posted: Thu Nov 14, 2019 03:30 PM
to create Your own images for testing
The latest release

Download

http://www.pflegeplus.com/DOWNLOADS/GrdPaint3.zip

created as JPG and saved again as BMP works
BMP, PNG and JPG are defined ( PNG works )



regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Missing images in xBrowse
Posted: Fri Nov 15, 2019 09:00 AM
I found a working solution for the moment

If BMP-format is selected I create a working PNG
next I load the PNG and save as BMP
next I delete the PNG

Code (fw): Select all Collapse
IF cType = ".bmp"
     cCounter := ALLTRIM(STR(nCount[1])) 
     cFile := c_path2 + "Img64_" + cCounter + ".png"
     oBmp[5]:Save( .T., cFile )
     FW_SaveImage( FW_ReadImage( nil, cFile )[ 1 ], ;
           c_path2 + "Img64_" + cCounter + cType )
     DELETE FILE &cFile
ELSE
     oBmp[5]:Save( .T., c_path2 + "Img64_" + cCounter + cType, 100 )
ENDIF




regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Missing images in xBrowse
Posted: Fri Nov 15, 2019 09:32 AM
ukoenig wrote:I found a working solution for the moment

If BMP-format is selected I create a working PNG
next I load the PNG and save as BMP
next I delete the PNG

Code (fw): Select all Collapse
IF cType = ".bmp"
     cCounter := ALLTRIM(STR(nCount[1])) 
     cFile := c_path2 + "Img64_" + cCounter + ".png"
     oBmp[5]:Save( .T., cFile )
     FW_SaveImage( FW_ReadImage( nil, cFile )[ 1 ], ;
           c_path2 + "Img64_" + cCounter + cType )
     DELETE FILE &cFile
ELSE
     oBmp[5]:Save( .T., c_path2 + "Img64_" + cCounter + cType, 100 )
ENDIF




regards
Uwe :-)


I still can not believe that xbrowse can not display a valid bmp and you have to find workarounds.

Can I see the bitmap that xbrowse can not display? If that is the case we will find a solution.
Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Missing images in xBrowse
Posted: Fri Nov 15, 2019 04:00 PM
with the new release I'm working on
I can change the XImage background-brush

I changed the brush and saved the image < as viewed >
I got a new image with a < blustone.bmp > - background
the brush AND image is saved correct like the filemanager shows
xBrowse shows only the image and ignores the background
maybe the tests can help to detect if there is something wrong
it seems the background is detected as transparent but it is a pattern brush



Loading the image in PIXELFORMER shows the background from
< blustone.bmp > transparent as well like xBrowse with a missing background :-)
I think the problem doesn't belong to xBrowse



the test bbb.bmp
It looks like there is a border around that makes it transparent :-)
I added -> oImage:lBmpTransparent := .F.
but no difference



Funny and hard to understand as a test I reloaded this posted image and it works



regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion