A Fileformat-problem with oBar:SaveToBmp(cFile)

A Fileformat-problem with oBar:SaveToBmp(cFile)

Postby ukoenig » Sat Jul 16, 2011 5: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 :

Image
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 )

Image

Pixelformer shows the Format-problem of the captured BMP.

Image

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

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

Postby Daniel Garcia-Gil » Sat Jul 16, 2011 5:42 pm

Uwe

Hello, please post a self container sample, thanks
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

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

Postby ukoenig » Sat Jul 16, 2011 8: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 :

Image

1. From the Main-screen select < Painter >

Image

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

Image

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.

Image

Image

Best Regards
Uwe :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

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

Postby ukoenig » Tue Jul 19, 2011 5: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 ).

Image

Image

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

Code: Select all  Expand view  RUN

// 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 :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 40 guests