Image PNG ( solved )

Image PNG ( solved )

Postby lailton.webmaster » Thu Oct 01, 2009 12:53 pm

Antonio,

How replace a oBmp1 to a Image png (Transparent)

( i don't convert png to bmp, i realy want use a png image... )

thanks
Last edited by lailton.webmaster on Thu Oct 01, 2009 6:54 pm, edited 2 times in total.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Image PNG ( to antonio )

Postby Daniel Garcia-Gil » Thu Oct 01, 2009 1:16 pm

Lailton...

you need use TImage Class

\samples\testimg.prg
\samples\testimg2.prg
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Image PNG ( to antonio )

Postby lailton.webmaster » Thu Oct 01, 2009 4:29 pm

Daniel,

look this:
http://www.redstarsoft.com.br/sample1.rar

look this that you will see the problem.

You think that fivewin can have comand native to use PNG ? because it use DLL freeimage, i think that it´s time of
fivewin have it native.

thanks so much for your help.

Note: ( Itryed too ON PAINT PalBmpDraw( hDC, 0, 0, oBmp1:hBitmap ) more too no work fine.. )
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Image PNG ( to antonio )

Postby Daniel Garcia-Gil » Thu Oct 01, 2009 4:51 pm

Hello Lailton

lailton.webmaster wrote:Daniel,

look this:
look this that you will see the problem.

You think that fivewin can have comand native to use PNG ? because it use DLL freeimage, i think that it´s time of
fivewin have it native.

thanks so much for your help.

Note: ( Itryed too ON PAINT PalBmpDraw( hDC, 0, 0, oBmp1:hBitmap ) more too no work fine.. )


Yes, i saw you problem, but is freeimagen fault.
is possible have PNG native, but no for now
you should convert png to alphabitmap

sample: Image
Code: Select all  Expand view

#include "FiveWin.ch"
function Main()

   local oWnd, oBmp1
   DEFINE WINDOW oWnd STYLE WS_POPUP COLOR CLR_WHITE,CLR_WHITE

          oBmp1:=TImage():new(0,0,120,125,,"test.bmp",.t.,ownd)
          oBmp1:lTransparent:=.t.
          oWnd:Center()
          SetTransparent( oWnd )

   ACTIVATE WINDOW oWnd ON PAINT PaintTransparent( hDC, oBmp1:hBitmap, 0, 0 )
   oBmp1:End()

return nil
//---------------------------------------------------------------------------------------------------//
#define LWA_COLORKEY  1
#define GWL_EXSTYLE   -20
#define WS_EX_LAYERED 524288
//---------------------------------------------------------------------------------------------------//
STATIC FUNCTION SETTRANSPARENT( oDlg )
   SETWINDOWLONG( oDlg:hWnd, GWL_EXSTYLE, NOR( GETWINDOWLONG( oDlg:hWnd, GWL_EXSTYLE ), WS_EX_LAYERED ) )
   SETLAYEREDWINDOWATTRIBUTES( oDlg:hWnd, CLR_WHITE,, LWA_COLORKEY )
RETURN NIL
//---------------------------------------------------------------------------------------------------//
function PaintTransparent( hDC, hBitmap, nRow, nCol )
   local hBmpOld := SelectObject( hDC, hBitmap )
   local nZeroZeroClr := GetPixel( hDC, 0, 0 )
   local nOldClr
   SelectObject( hDC, hBmpOld )
   nOldClr = SetBkColor( hDC, CLR_WHITE )
   TransBmp( hBitmap, nBmpWidth( hBitmap ), nBmpHeight( hBitmap ), nZeroZeroClr, hDC, nRow, nCol, nBmpWidth( hBitmap ), nBmpHeight( hBitmap ) )
   SetBkColor( hDC, nOldClr )          
return nil
//---------------------------------------------------------------------------------------------------//
 
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Image PNG ( to antonio )

Postby lailton.webmaster » Thu Oct 01, 2009 5:10 pm

Daniel,

The problem using as bmp is:

Size of file is but..

png file have 8,106 Bytes
bmp file have 60,056 Bytes

Quality

It´s very good !
Image

It´s +/- ( but to bad ... )
Image


How i say before, png is execellent, all language have suport this, think that it´s time
of fivewin too have native suport and remove freeimage.dll :D ( or use only to bmp file.. )

other ASK

that program you use to convert png to bmp ?

thanks.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Image PNG ( to antonio )

Postby Daniel Garcia-Gil » Thu Oct 01, 2009 5:23 pm

Lailton...

Photoshop
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Image PNG ( to antonio )

Postby mmercado » Thu Oct 01, 2009 5:42 pm

Lailton:
lailton.webmaster wrote:that program you use to convert png to bmp ?


You can also use PixelFormer it's a very good program and it's !! free !!.

Un abrazo.
manuelmercado at prodigy dot net dot mx
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: Image PNG ( to antonio )

Postby lailton.webmaster » Thu Oct 01, 2009 6:54 pm

mMercado,

Really Very good !

i will use this solucion at a day i can use direct by fivewin [:D]

Thanks for yours Help Daniel and mMercado.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Image PNG ( solved )

Postby ukoenig » Thu Oct 01, 2009 7:04 pm

You can search for < Pixelformer > in the Forum.
I have written some Instructions about this Application, how to use it.
As well You can find the Download-Link.

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: Image PNG ( solved )

Postby lailton.webmaster » Thu Oct 01, 2009 7:16 pm

I already found link and im using fine this aplication

thanks .
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 61 guests