RESOURCE BITMAP : how many Color ?

RESOURCE BITMAP : how many Color ?

Postby Jimmy » Wed Jul 27, 2022 9: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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: RESOURCE BITMAP : how many Color ?

Postby cmsoft » Wed Jul 27, 2022 10:23 pm

Jimmy:
You can upload JPG, PNG, BMP format as follows in your RC
Code: Select all  Expand view
NamePng RCDATA "myfileimage.png"

Where NamePrn will be the name of the resource
myfileimage.png will be the file on disk
User avatar
cmsoft
 
Posts: 1289
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: RESOURCE BITMAP : how many Color ?

Postby nageswaragunupudi » Thu Jul 28, 2022 2: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
User avatar
nageswaragunupudi
 
Posts: 10626
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: RESOURCE BITMAP : how many Color ?

Postby Jimmy » 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 ... :o

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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: RESOURCE BITMAP : how many Color ?

Postby Giovany Vecchi » 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/
User avatar
Giovany Vecchi
 
Posts: 223
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: RESOURCE BITMAP : how many Color ?

Postby nageswaragunupudi » Fri Jul 29, 2022 1:24 pm

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


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: Select all  Expand view
PHONE RCDATA "c:\fwh\bitmaps\32x32\phone.bmp"

No extra work on your part is required.

Please try this test program:
Code: Select all  Expand view
#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: Select all  Expand view
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"


Image
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests