AlphaChannel BMP Problem!!!!

AlphaChannel BMP Problem!!!!

Postby Bayron » Fri Sep 09, 2011 11:07 pm

Hi everyone,
I have a little problem with this BMP:
http://www.mayapos.com/FiveWin/claudia.bmp

Because when I activate AlphaChannel with Axialis IconWorkshop, It's shown like this:

Image

I tried this code before converting the image to alpha channel:
Code: Select all  Expand view
DEFINE IMAGE oImage FILE '\MayaPOS\graficos\Camareros\CLAUDIA.bmp'
msgalert( HasAlpha( oImage:hBitmap ) )
 

And It returns .F.

I tried to convert it and show it with BtnBmp and with @X,Y IMAGE, Transparent and not Transparent, and it's the same...

After conversion, the image it's Ok if I open it with Paint or Axialis or Windows Image Viewer, what could be the problem???
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: AlphaChannel BMP Problem!!!!

Postby Bayron » Fri Sep 09, 2011 11:25 pm

Done some test, and I think it has to be something with the AlphaChannel class or functions, because I tried:

Save it with Paint
Save it with Axialis
Copy image from web page
and copy with print screen and paste it to Paint

It looks something color specific on this image... I don't supply the images to the costumer and it's imposibble to check every one, what can I do???
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: AlphaChannel BMP Problem!!!!

Postby ukoenig » Sat Sep 10, 2011 12:30 am

Hello Byron,

to display the Image, there is no Reason, to add a Alpha-channel,
but if You want to include it, You can use < Pixelformer >

1. Menu File => Import ( Your Image )
2. Menu Image => Properties => change to RgbColor with Alphachannel ( 32bpp )
3. Menu File => Export ( new Image-name )
4. activate in Dialog BMP-options => Premultiplied Alpha

With this Program You will get the needed Result.
http://www.qualibyte.com/pixelformer/

Image

The generated Source from the Screenshot above :

Code: Select all  Expand view

#include "fivewin.ch"
#include "Image.ch"
#include "ttitle.ch"

STATIC oWnd

FUNCTION MAIN()
LOCAL oBtn1, oBtn2

SET _3DLOOK ON
SetBalloon( .T. ) // Balloon shape required for tooltips

PUBLIC c_path := CURDRIVE() + ":\" + GETCURDIR()
PUBLIC nSWidth := GetSysMetrics(0), nSHeight := GetSysMetrics(1)
PUBLIC oSysfont1 := TFont():New( "
Arial", 0, 16,.F.,.T.,  0,  0,  0,.F.,.F.)
PUBLIC oHeadFont := TFont():New( "
Arial",0  ,-22,.F.,.T.,0  ,0,0,.F.,.F.)
PUBLIC oTextFont := TFont():New( "
Arial",0  ,-18,.F.,.T.,0  ,0,0,.F.,.F.)

DEFINE WINDOW oWnd ;
FROM 30, 30 TO 500, 700 PIXEL TITLE "
Mesage and xBrowse"

SHOW_MSG(oWnd)

@ nSHeight - 160, nSWidth - 200 BTNBMP oBtn2 SIZE 150, 60 OF oWnd  2007 ;
FILENAME c_path + "
\Bitmaps\quit.bmp" ;
LEFT ;
PROMPT "
 &Exit  " ;
FONT oSysfont1 ;
ACTION oWnd:End()
oBtn2:lTransparent = .t.
oBtn2:cTooltip :=  { "
Close" + CRLF + ;
        "
Message-test","Close Window", 1, CLR_BLACK, 14089979 }

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT WND_BRUSH( oWnd, "
FANTASY3.JPG   " )

oSysFont1:End()
CLOSE DATABASE

RETURN NIL

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

FUNCTION WND_BRUSH( cControl, cImage )
LOCAL hDC, oBrush

IF File( c_path + "
\bitmaps\" + cImage )
    DEFINE BRUSH oBrush FILE c_path + "
\Bitmaps\" + cImage
    SET BRUSH OF cControl TO oBrush
    RELEASE BRUSH oBrush
ELSE
    MsgAlert( "
Cannot load : " + CRLF + ;
             c_path + "
\bitmaps\" + cDImage, "Error" )
ENDIF

RETURN NIL

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

FUNCTION SHOW_MSG( oControl )
LOCAL oBar1


@ 60, 50 TITLE oBar1 SIZE 350, 250 OF oControl SHADOW BOTTOMRIGHT SHADOWSIZE 14

@ 15, 140 TITLETEXT oTitle OF oBar1 TEXT "
About-message" FONT oHeadFont COLOR 65535

@ 52, 140 TITLETEXT oText1 OF oBar1 TEXT  "
New Line 1" FONT oTextFont COLOR 16776960
@ 85, 140 TITLETEXT oText2 OF oBar1 TEXT  "
Line 2" FONT oTextFont COLOR 16776960

@ 20, 20 TITLEIMG oBmp1 OF oBar1 BITMAP  c_Path + "
\Bitmaps\CLAUDIA1.BMP" SIZE 95, 120 ANIMA LEVEL 255 ;
ACTION ( NIL)

oBar1:lRound := .T.
oBar1:lBorder := .T.
oBar1:nClrLine1 := 255

IF FILE( c_Path + "
\Bitmaps\FANTASY1.JPG" )
    oBar1:aGrdBack := {}
    DEFINE BRUSH oBrush  FILENAME c_Path + "
\Bitmaps\FANTASY1.JPG"
    SET BRUSH OF oBar1 TO oBrush:Resized( 350, 250, 1 )
    RELEASE BRUSH oBrush
ELSE
    MsgAlert( "
File : FANTASY1.JPG" + CRLF + ;
            "
does not exist" + CRLF + ;
            "
to create Brush !", "ATTENTION" )
ENDIF

@ 191, 291 BTNBMP oBtn OF oBar1 ;
SIZE 40, 45 PIXEL;
NOBORDER ;
PROMPT "
&OK" ;
FILENAME c_path + "
\Bitmaps\Btn1.bmp" ;
ACTION oWnd:End() ;
FONT oSysFont1 ;
CENTER
oBtn:lTransparent := .t.
oBtn:cToolTip =  { "
Close " + CRLF + "Message","Message End", 1, CLR_BLACK, 14089979 }
oBtn:SetColor( 0, )

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: AlphaChannel BMP Problem!!!!

Postby Bayron » Sat Sep 10, 2011 5:40 pm

Thanks Uwe, as usual all your sugestions are the best ones for me...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 51 guests