FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour RESOURCE BITMAP : how many Color ?
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
RESOURCE BITMAP : how many Color ?
Posted: Wed Jul 27, 2022 09:47 PM

hi,

i got Error "wrong Format" when try using 24Bit BMP as Resource :shock:
than i have convert to 4Bit and that work ... but no "Transparency" in MENU ...

so what Format can i use in *.RC :?:

greeting,

Jimmy
Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: RESOURCE BITMAP : how many Color ?
Posted: Wed Jul 27, 2022 10:23 PM
Jimmy:
You can upload JPG, PNG, BMP format as follows in your RC
Code (fw): Select all Collapse
NamePng RCDATA "myfileimage.png"

Where NamePrn will be the name of the resource
myfileimage.png will be the file on disk
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: RESOURCE BITMAP : how many Color ?
Posted: Thu Jul 28, 2022 02:20 PM

You should not have problems with 24 bit bitmaps.
Yes, for 32 bit alpha bitmaps and other formats (jpg,png,etc) use RCDATA

Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: RESOURCE BITMAP : how many Color ?
Posted: Thu Jul 28, 2022 10:48 PM
hi
nageswaragunupudi wrote:You should not have problems with 24 bit bitmaps.

i have take Bitmap from c:\fwh\bitmaps\32x32\ but still got "Format" Error ... :-)

i have reduce to 8 Bit which work but have "no Transparency" in MENU
btw 32 Bit BCC 7

nageswaragunupudi wrote:Yes, for 32 bit alpha bitmaps and other formats (jpg,png,etc) use RCDATA

Ok. Thx
greeting,

Jimmy
Posts: 244
Joined: Mon Jun 05, 2006 09:39 PM
Re: RESOURCE BITMAP : how many Color ?
Posted: Thu Jul 28, 2022 11:31 PM
Import your bmps with Pixelforms and export to bmp with the Premultiplied alpha option.
Download here:
https://www.qualibyte.com/
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: RESOURCE BITMAP : how many Color ?
Posted: Fri Jul 29, 2022 01:24 PM
i have take Bitmap from c:\fwh\bitmaps\32x32\ but still got "Format" Error ... :-)


This folder contains some 32-bit alpha bitmaps also.

If you get the error 17 Invalid bitmap format error, then the bitmap is 32-bit, but definitely not 24/16/8/4/2 bits.

Immediately, change BITMAP as RCDATA in your rc file.
Code (fw): Select all Collapse
PHONE RCDATA "c:\fwh\bitmaps\32x32\phone.bmp"

No extra work on your part is required.

Please try this test program:
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oWnd, oBar

   DEFINE WINDOW oWnd

   // 24 Bit
   DEFINE BUTTONBAR oBar OF oWnd SIZE 64,64 2007 HEIGHT 96
   SET MESSAGE OF oWnd TO "bitmaps" 2007

   DEFINE BUTTON OF oBar RESOURCE "CASCADE" GROUP LABEL "24 Bits"
   DEFINE BUTTON OF oBar RESOURCE "ATTACH"
   DEFINE BUTTON OF oBar RESOURCE "COPY"

   // 32 Bit Alpha bitmaps
   DEFINE BUTTON OF oBar RESOURCE "DOWN" GROUP LABEL "32 Bit Alpha"
   DEFINE BUTTON OF oBar RESOURCE "PHONE"
   DEFINE BUTTON OF oBar RESOURCE "POCKETPC"


   oWnd:nWidth    := 500
   oWnd:nHeight   := 700

   ACTIVATE WINDOW oWnd CENTERED ;
      ON PAINT oWnd:DrawImage( "OLGA", oWnd:GetCliAreaRect():aRect )

return nil


rc file
Code (fw): Select all Collapse
CASCADE  BITMAP "c:\fwh\bitmaps\32x32\cascade.bmp"
ATTACH   BITMAP "c:\fwh\bitmaps\32x32\attach.bmp"
COPY     BITMAP "c:\fwh\bitmaps\32x32\copy.bmp"

DOWN     RCDATA "c:\fwh\bitmaps\32x32\down.bmp"
POCKETPC RCDATA "c:\fwh\bitmaps\32x32\pocketpc.bmp"
PHONE    RCDATA "c:\fwh\bitmaps\32x32\phone.bmp"

OLGA     RCDATA "c:\fwh\bitmaps\olga1.jpg"


Regards



G. N. Rao.

Hyderabad, India

Continue the discussion