RESOURCE BITMAP : how many Color ?

Post Reply
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

RESOURCE BITMAP : how many Color ?

Post by Jimmy »

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
cmsoft
Posts: 1297
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina
Been thanked: 2 times

Re: RESOURCE BITMAP : how many Color ?

Post by cmsoft »

Jimmy:
You can upload JPG, PNG, BMP format as follows in your RC

Code: Select all | Expand

NamePng RCDATA "myfileimage.png"

Where NamePrn will be the name of the resource
myfileimage.png will be the file on disk
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: RESOURCE BITMAP : how many Color ?

Post by nageswaragunupudi »

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
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: RESOURCE BITMAP : how many Color ?

Post by Jimmy »

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

Re: RESOURCE BITMAP : how many Color ?

Post by Giovany Vecchi »

Import your bmps with Pixelforms and export to bmp with the Premultiplied alpha option.
Download here:
https://www.qualibyte.com/
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: RESOURCE BITMAP : how many Color ?

Post by nageswaragunupudi »

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

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

#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

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
Post Reply