FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How can I use image on image with all transparent?
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
How can I use image on image with all transparent?
Posted: Thu Sep 27, 2018 01: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 (fw): Select all Collapse
   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 ))



Thank you in advance,
Regards,

Dutch



FWH 2304 / 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)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: How can I use image on image with all transparent?
Posted: Thu Sep 27, 2018 04:49 PM
Code (fw): Select all Collapse
#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


Regards



G. N. Rao.

Hyderabad, India
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: How can I use image on image with all transparent?
Posted: 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 2304 / 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)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: How can I use image on image with all transparent?
Posted: Fri Sep 28, 2018 08: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

Continue the discussion