How can I use image on image with all transparent?

How can I use image on image with all transparent?

Postby dutch » Thu Sep 27, 2018 1:30 pm

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,
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1540
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Postby nageswaragunupudi » Thu Sep 27, 2018 4:49 pm

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
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby dutch » Thu Sep 27, 2018 11:57 pm

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,
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1540
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Postby nageswaragunupudi » Fri Sep 28, 2018 8:13 am

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 29 guests