FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour A Fileformat-problem with oBar:SaveToBmp(cFile)
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

A Fileformat-problem with oBar:SaveToBmp(cFile)

Posted: Sat Jul 16, 2011 05:04 PM
Hello,

I noticed a File ( BMP ) -format-problem, using oBar:SaveToBmp( cFile )
Adding the saved BMP*s to xBrowse, the Background is not visible.
I converted the saved BMP to JPG and back to BMP. After that, it was OK.

The Problem inside the Project-browser showing the BMP-captures with different backgrounds :


Loaded the captured BMP with Pixelformer, shows a transparent Background
( like You can see in xBrowse, 1. Screenshot )

The BMP converted to JPG, next JPG saved as BMP. Result is OK.
Olga is a original JPG saved as BMP ( no capture )



Pixelformer shows the Format-problem of the captured BMP.



Best 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: 2365
Joined: Wed Nov 02, 2005 11:46 PM

Re: A Fileformat-problem with oBar:SaveToBmp(cFile)

Posted: Sat Jul 16, 2011 05:42 PM

Uwe

Hello, please post a self container sample, thanks

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: A Fileformat-problem with oBar:SaveToBmp(cFile)

Posted: Sat Jul 16, 2011 08:24 PM
Daniel,

You can test it with the new Tool.
I'm still working on the Project-section, but the needed Fields are included.
You can create a PRG- and EXE with the defined Selections.
I still need some Days for the final Release.
It will be possible, to save everything to a DBF-record and loading a Set from the Project-manager.
To do these things without a Result-preview at Runtime, would be a hard Job.

A xBrowse-preview You will get with selecting < Dialog >
The browser uses the same Settings like the Message.
Message-title Font and Color = xBrowse-header,
Message-text Font and Color = xBrowse-data.
The same with Background.

Download ( 4.1 MB ) : http://www.pflegeplus.com/fw_downloads/message1.zip

Is is a all in one- solution :
Windows, Dialog, VTitles( Messages ), Fonteditor ( 2 for Head and Text ) and xBrowse.

I think, I found the Reason for the missing Display.
Xbrowse cannot display this Format ( 32 bpp )

A Capture-result :



1. From the Main-screen select < Painter >



2. define a Name for the Capture and select Folder-page < Project >



3. Inside the Browser, select Your Captures
To get Capture-backgrounds visible, You can use MsPaint : load a Capture, save the 32bb-BMP as JPG
JPG is supported from xBrowse.





Best 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: A Fileformat-problem with oBar:SaveToBmp(cFile)

Posted: Tue Jul 19, 2011 05:25 PM
Daniel,

I solved the xBrowse-display-problem, saving the Capture as a JPG-image

I added some more Options to the new Tool.
Now the User can modify his Logo, adding different Frame-styles.
The Result is saved as a new Image ( with underline to keep the Original ) => _MyLogo.jpg
The Result is displayed in a extra Dialog, changing the Frame-style.
( I couldn't use a Brush, because of showing the Frame, I needed some space around ).





Saving a BMP-capture as a JPG-file using : oObject:SaveToBmp( "Capture.bmp" )

Code (fw): Select all Collapse
// c_path := CURDRIVE() + ":\" + GETCURDIR()

FUNCTION JPG_CAPTURE()
LOCAL cOldfile := c_path + "\Bitmaps\" + Alltrim(cScreenshot) + ".bmp"
LOCAL cNewfile := c_path + "\Bitmaps\" + Alltrim(cScreenshot) + ".jpg"
LOCAL cScript := 'NCONVERT -quiet -out jpeg ' + cOldfile   

// saves a VTitle or any other Object   
oBar:SaveToBmp( cOldfile )
    
IF FILE( c_path + "\nConvert.exe" )     
      WAITRUN ( cScript, 0 )
      IF FILE( cNewfile ) 
            MsgAlert( "The Screenshot is saved " + CRLF + ;
                    "in Subdirectory \Bitmaps" + CRLF + ;
                    "as : " + cNewfile, "Attention")
      ELSE
            MsgAlert( "The File : " + CRLF + ;
                    cNewfile + CRLF + ; 
                    "is not created !!!", "ERROR")
      ENDIF
ELSE
      MsgAlert( "nConvert.exe is missing !" + CRLF + ;
                "cannot convert to JPG !!", "ERROR" )
ENDIF

RETURN NIL


Best 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