FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Check of bitmap is defined in RC-file
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Check of bitmap is defined in RC-file
Posted: Fri Oct 24, 2008 07:50 AM
Hi,

Is there a way to check if an bitmap defined in the RC-file

TRUCK   BITMAP _Buttons\truck.bmp
TRUCK2  BITMAP _Buttons\truck2.bmp


If for example TRUCK2 is defined i want to use that BITMAP, otherwise I use TRUCK.

Thanks,
Marc
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Check of bitmap is defined in RC-file
Posted: Fri Oct 24, 2008 11:47 AM

Is this possible?

Thanks,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Check of bitmap is defined in RC-file
Posted: Fri Oct 24, 2008 12:00 PM
Marc,

This the way to define bitmaps at RC files:

ANY_IMAGE_I   BITMAP "..\\folder\\image_1.bmp"
ANY_IMAGE_II  BITMAP "..\\folder\\image_2.bmp"


There is a function for load these bitmaps:
loadBitmap( , "ANY_IMAGE_I" )

I think, if this function returns nothing... this is because the resource named ANY_IMAGE_I not exists into RC file...
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Check of bitmap is defined in RC-file
Posted: Fri Oct 24, 2008 12:27 PM
Thanks Júlio César,

If I call
loadBitmap( GetResources(), "TRUCK" )


The function returns '0' if it doesn't exist.

Regards,
Marc
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Check of bitmap is defined in RC-file
Posted: Fri Oct 24, 2008 05:58 PM

Marc,

Thats a valid solution. Another way is to use FindResource():

FindResource( GetResources(), "TRUCK", 2 ) != 0

2 means that it is a bitmap

FiveWin uses it in source\classes\menu.prg

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Check of bitmap is defined in RC-file
Posted: Fri Oct 24, 2008 06:06 PM

Very more clean!

Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Check of bitmap is defined in RC-file
Posted: Fri Oct 24, 2008 06:44 PM

Thanks Antonio,

Regards,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite

Continue the discussion