Page 1 of 1

How can I use image on image with all transparent?

PostPosted: Thu Sep 27, 2018 1:30 pm
by dutch
Dear All,
The oBmp1 can not transparent on oBmp2.
- oBmp1 = "LOGO3" is True Color + Alpha (32bits) in (RES).
- oBmp2 is JPG file.
How can I make oBmp1 as transparent?
Code: Select all  Expand view
  DEFINE WINDOW oWnd  ICON oIcon ;
                      MENU BuildMenu()

   @  0, 0 BITMAP oBmp1 RESOURCE "LOGO3" OF oWnd NOBORDER  
   oBmp:nAlphaLevel := 150
 
   @  200, 250 BITMAP oBmp2 FILE "C:\IMAGE\BACKGROUND.JPG" OF oWnd NOBORDER SIZE (GetSysMetrics(0)), (GetSysMetrics(1)) PIXEL ADJUST
   oBmpBk:nAlphaLevel := 60

   ACTIVATE WINDOW oWnd MAXIMIZED ;
                ON PAINT (oBmp:Move((oWnd:nHeight() - oBmp:nHeight())-115, (oWnd:nWidth() - oBmp:nWidth())-25 ))

Image

Thank you in advance,

Re: How can I use image on image with all transparent?

PostPosted: Thu Sep 27, 2018 4:49 pm
by nageswaragunupudi
Code: Select all  Expand view
#include "fivewin.ch"

function WndBckAndLogo

   local oWnd, oBar, oBrush

   DEFINE BRUSH oBrush FILE "c:\fwh\bitmaps\sea.bmp" RESIZE
   DEFINE WINDOW oWnd BRUSH oBrush

   ACTIVATE WINDOW oWnd ;
      ON PAINT oWnd:DrawImage( "c:\fwh\bitmaps\AlphaBmp\android.bmp", , , , , , "BR" )
   RELEASE BRUSH oBrush

return nil
 


Image

Re: How can I use image on image with all transparent?

PostPosted: Thu Sep 27, 2018 11:57 pm
by dutch
Dear Mr.Rao,

I work as your sample but all image is files. I need to save backgroup (sea.bmp) to MEDIUMBLOB and logo (android.bmp) to MEDIUMBLOB or RESOURCE (RES)?

How can I do that?

Thanks in advance,

Re: How can I use image on image with all transparent?

PostPosted: Fri Sep 28, 2018 8:13 am
by nageswaragunupudi
Saving an image to a blob field of mysql table using fwmaridb library:

Inserting a new record:
oCn:Insert( <tablename> , <blobfieldname>, { MEMOREAD( <imagefile> ) } )

Update (change) blob field in a record already existing in the table
oCn:Insert( <tablename>, { <primarykey>, <blobfieldname> }, { <primarykeyvalue>, MEMOREAD( <imagefile> ) }, .t. )


To RC

rc file

If the logo is non-alpha bmp
LOGO BITMAP "filename"

if the logo is alphabmp or any other type like jpg, etc
LOGO 10 "filename"