SetAlpha

SetAlpha

Postby Otto » Tue Jul 19, 2011 11:44 pm

I have made a program to show bmp´s. To show the bitmaps I need SetAlpha.
Code: Select all  Expand view
activate window ::oWnd MAXIMIZED ON INIT ( ( SetAlpha( lSetAlpha := !lSetAlpha ), oBmp:Refresh() )  )


But then when I move the mouse over the ribbonbar the bitmaps of the ribbon change.
How can I prevent this?
Thanks in advance
Otto
Code: Select all  Expand view
 @ 155,780 BITMAP oBmp FILENAME "c:\fwh\samples\test.bmp" OF ::oWnd ;
         SIZE 880,800 PIXEL SCROLL  //ADJUST

      oBmp:nAlphaLevel := 100
      oBmp:bAlphaLevel := {| oBmp | if( oBmp:nZoom > 2, oBmp:nAlphaLevel := 255, oBmp:nAlphaLevel:= oBmp:hAlphaLevel  )  }

 

Image
Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: SetAlpha

Postby Otto » Fri Jul 22, 2011 8:52 am

Is it possible to setAlpha only for a single control in my case oBitmap?
Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: SetAlpha

Postby ukoenig » Fri Jul 22, 2011 10:56 pm

Otto,

it is possible. Maybe You like this Solution ( Alpha-level from 50 - 255 ) :

Image

Image

Folder-Brush-combinations :

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: SetAlpha

Postby Otto » Sat Jul 23, 2011 6:13 am

Dear Uwe,
thank you for your help.

Please try fwh/samples/ribbon.prg and insert SetAlpha( lSetAlpha := .f. ).

You get then following result which is not nice looking.
Image
Without SetAlpha( lSetAlpha := .f. )
@ x,y BITMAP oBmp FILENAME " test.bmp" OF oWnd SIZE 880,800 PIXEL SCROLL
does not show 32 bit deep bitmaps correctly but which I need.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: SetAlpha

Postby ukoenig » Sat Jul 23, 2011 7:52 am

Otto,

my test with a 32 bit Logo.
I could not detect a difference of the Logo-quality ?
Maybe something changed in FWH-release ?

DEFINE WINDOW oWnd TITLE "RibbonBar Test " + FWVERSION from 1,1 to 600,600 pixel //brush oBrush1
@ 150, 10 BITMAP oBmp FILENAME c_path + "\bitmaps\Logo1.bmp" OF oWnd SIZE 550, 350 PIXEL SCROLL

Image

Added Bitmaps to sample ribbon.prg ( Animation and Reflex ) :
( for better Bmp-quality, don't resize ! )

Image
Code: Select all  Expand view

ADD GROUP oGr5 RIBBON oRBar TO OPTION 2 PROMPT "BMP-Test" width 590 //BITMAP "..\bitmap\fivetech.BMP"

@  10, 1  TITLE oTitle1 SIZE 595, 78 OF oGr5 TRANSPARENT  NOBORDER  SHADOWSIZE 0
oTitle1:lTransparent := .F.
oTitle1:aGrdBack := { { 0.9,16305560, 16771818 }, { 0.9, 16771818,16305560 } }

@ 10, 70 TITLEIMG  oBmp1  OF oTitle1  BITMAP c_Path + "\Bitmaps\alphabmp\files.bmp" SIZE 24, 24  REFLEX  ANIMA LEVEL 255 ;
ACTION  MsgAlert( "Image 1", "Attention" )

@ 5, 140 TITLEIMG  oBmp2  OF oTitle1  BITMAP c_Path + "\Bitmaps\alphabmp\graphics.bmp" SIZE 24, 24  REFLEX  ANIMA LEVEL 50 ;
ACTION  MsgAlert( "Image 2", "Attention" )

@ 10, 210 TITLEIMG  oBmp3  OF oTitle1  BITMAP c_Path + "\Bitmaps\alphabmp\info.bmp" SIZE 24, 24  REFLEX  ANIMA LEVEL 255 ;
ACTION  MsgAlert( "Image 3", "Attention" )

@ 10, 280 TITLEIMG  oBmp4  OF oTitle1  BITMAP c_Path + "\Bitmaps\alphabmp\printer.bmp" SIZE 24, 24  REFLEX  ANIMA LEVEL 255 ;
ACTION  MsgAlert( "Image 4", "Attention" )
 


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: SetAlpha

Postby Otto » Sat Jul 23, 2011 9:52 am

Hello Uwe,
here the results are like the attached screen shots:

Do you have any idea? I upload my bmp so if you would be so kind to test with my bmp-file.
Thanks in advance
Otto

Image

Image

http://www.atzwanger-software.com/fw/Angebotsbrief.zip
Last edited by Otto on Sat Jul 23, 2011 11:25 am, edited 1 time in total.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: SetAlpha

Postby ukoenig » Sat Jul 23, 2011 10:07 am

Otto,

can You please test the Download-link ?
it is not working.

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: SetAlpha

Postby Otto » Sat Jul 23, 2011 11:26 am

Hello Uwe,
I changed the link. Now it should work.
Thank you and best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: SetAlpha

Postby ukoenig » Sat Jul 23, 2011 12:29 pm

Hello Otto,

I think, You used a Screencapture => SavetoBMP( .... )?
I noticed the same problem, trying to include it in xBrowse.
I converted the Screencapture to a Jpg, after that, it was OK.
There is thomething wrong with the Format ( I told in another Post ).
I will look for a working Solution to fix the Structure and keeping the BMP-format.

Loading the BMP with another Program and saving, fixed the Problem.
After that it works fine, like You can see.
Try to load the BMP with Pixelformer and You will see the Format-problem.

BMP-capture loaded and saved again ( maybe the original BMP-Structure is corrupted )

Download :
http://www.pflegeplus.com/fw_downloads/brief.zip

Image

Loaded with xNView ( shows the same Problem ) :

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Sat Jul 23, 2011 2:53 pm, edited 1 time in total.
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: SetAlpha

Postby Otto » Sat Jul 23, 2011 1:11 pm

Hello Uwe,
thank you. Yes you are right I make a screen capture.
As it is displaying with SetAlpha(.f.) perfectly I think ribbon-class must be changed to work proberly.
This screen capture program I made – it makes automatically screen captures from M S W OR D – is such a
great tool.
Now I can browse folders with docx files and have in real time previews of the word documents not only thumbnails.
This is so useful.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: SetAlpha

Postby ukoenig » Sat Jul 23, 2011 2:43 pm

Otto,

a Solution convert to Jpg ( much faster and small in Filesize with good Quality )
I use this, because of the same problem with xBrowse.
( You have NCONVERT.exe ? must exist in Your Main-directory of Your program )

Download ( new Release of nConvert ) :
http://www.pflegeplus.com/fw_downloads/nconv.zip

Code: Select all  Expand view

local cScreenshot := "Angebotsbrief"

c_path := CURDRIVE() + ":\" + GETCURDIR()

DEFINE WINDOW oWnd TITLE "
RibbonBar Test " + FWVERSION from 1,1 to 600,600 pixel //brush oBrush1

MAKE_JPG( cScreenshot )

// change from Bitmap to Image !!!

@ 150, 10 IMAGE oBmp FILENAME c_path  + "
\bitmaps\" + cScreenshot + ".jpg"  ;
OF oWnd SIZE 1000, 520 PIXEL SCROLL
...
...

//----------------------------------------------------------------------------//

FUNCTION MAKE_JPG( cScreenshot )
LOCAL cScript
LOCAL cOldfile := c_path + "
\Bitmaps\" + cScreenshot + ".Bmp"
LOCAL cNewfile := c_path + "
\Bitmaps\" + cScreenshot + ".jpg"

IF FILE( cOldfile )
    IF FILE( c_path + "
\nConvert.exe" )
        cScript := 'NCONVERT -quiet -out jpeg ' + cOldfile  

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

Re: SetAlpha

Postby Otto » Sat Jul 23, 2011 5:59 pm

Uwe, thank you so much. Now it is working fine.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: SetAlpha

Postby ukoenig » Mon Jul 25, 2011 10:10 am

Otto,

converting BMP to JPG, there are still more Parameters possible like :
Image-crop ( I noticed there is much space around the text ),
adding a Frame to the Dokument ..
maybe You want to add any of these possibilities ?

Crop Image and define a 3D-Frame- Size and Color :

Samples are adding a Frame to the BMP and saving with a new Name ( no Crop )
You can test it from Command-line ( change the BMP-path )

1. a blue Frame
convert -quiet e:\t_ribbontest\Bitmaps\angebotsbrief.Bmp -mattecolor SkyBlue -frame 16x16+8+8 e:\t_ribbontest\Bitmaps\_angebotsbrief.Bmp

2. a red Frame
convert -quiet e:\t_ribbontest\Bitmaps\angebotsbrief.Bmp -mattecolor Tomato -frame 16x16+8+8 e:\t_ribbontest\Bitmaps\_angebotsbrief.Bmp

Image

Different Frame-samples ( from Commandline ) :
1
CONVERT -quiet e:\t_message\bitmaps\olga.bmp -mattecolor SkyBlue -frame 6x6+3+3 e:\t_message\bitmaps\_olga.bmp
2
CONVERT -quiet e:\t_message\bitmaps\olga.bmp -mattecolor Tomato -frame 10x10+5+5 e:\t_message\bitmaps\_olga.bmp
3
CONVERT -quiet e:\t_message\bitmaps\olga.bmp -mattecolor SkyBlue -frame 10x10+10+0 -frame 15x15+10+0 e:\t_message\bitmaps\_olga.bmp

Image

A crop-sample : save a Part to a new Image.

convert e:\t_message\bitmaps\olga.jpg -crop "0x0+150+200" e:\t_message\bitmaps\_olga.jpg

Image

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: SetAlpha

Postby ukoenig » Sun Jul 31, 2011 10:32 pm

Otto,

I'm working on a Tool to change Image-properties at Runtime.
( Scriptgenerator for NConvert )
I can add a Download-link, in case it is something You need.
The 1. Ribbonbar-tab shows the Selection the 2. and 3. will include the different Value-settings.
( I will still add some more like Brigthness, Rotate and so on ... )

1. Convert a BMP-screenshot to any Image-format
2. Sharpen
3. Contrast
4. Blur
5. Crop a Image and save as new
6. Resize to given % or keep Ratio with defined Width or Hight
7. Add Watermark ( any Image on defined Position and transparent-level.
8. TIFF image-extract

Image

Converts any selected Image to a new Format and generates a Script, can be used inside Your Application.

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Silvio.Falconi and 99 guests