FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Resource Bitmap for Fivewin
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Resource Bitmap for Fivewin
Posted: Thu Oct 27, 2022 12:10 PM
hi,

i often have "Problem" with BMP as Resource under Fivewin (work with Xbase++ and HMG)

now i have figure out that those BMP have no DPI Setting (most i "save" from Windows PAINT)


when change to 96 x 96 DPI and "save" it work with Fivewin without Problem
but i have to change it manual using InfanView ...

Question : is there a API Way to change DPI of BMP :idea:
greeting,

Jimmy
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Resource Bitmap for Fivewin
Posted: Thu Oct 27, 2022 12:16 PM

Good to know, thank you.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Resource Bitmap for Fivewin
Posted: Fri Oct 28, 2022 06:13 PM

Can you please send me a few sample bmp files for testing here?

nageswaragunupudi [at] gmail [dot] com

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Resource Bitmap for Fivewin
Posted: Sun Oct 30, 2022 04:17 AM
Thanks for sending the bmp files.
This is the way we can use these bmp files directly or as resource as it is, without any modifications.

jimmybmp.prg
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oDlg, oBar

   DEFINE DIALOG oDlg SIZE 700,300 PIXEL TRUEPIXEL RESIZABLE
   DEFINE BUTTONBAR oBar OF oDlg SIZE 48,48 2007 HEIGHT 68

   DEFINE BUTTON OF oBar FILE "c:\jimmy\bitmaps\no_dpi\about.bmp" ;
      GROUP LABEL "FILE" COLORS CLR_BLACK,CLR_YELLOW
   DEFINE BUTTON OF oBar FILE "c:\jimmy\bitmaps\no_dpi\clean32.bmp"
   DEFINE BUTTON OF oBar FILE "c:\jimmy\bitmaps\no_dpi\cleanup.bmp"
   DEFINE BUTTON OF oBar FILE "c:\jimmy\bitmaps\no_dpi\clipboard.bmp"
   DEFINE BUTTON OF oBar FILE "c:\jimmy\bitmaps\no_dpi\cloud.bmp"
   DEFINE BUTTON OF oBar FILE "c:\jimmy\bitmaps\no_dpi\colors.bmp"
   //
   DEFINE BUTTON OF oBar RESOURCE "ABOUT" ;
      GROUP LABEL "RESOURCE" COLORS CLR_BLACK, CLR_HGREEN
   DEFINE BUTTON OF oBar RESOURCE "CLEAN32"
   DEFINE BUTTON OF oBar RESOURCE "CLEANUP"
   DEFINE BUTTON OF oBar RESOURCE "CLIPBOARD"
   DEFINE BUTTON OF oBar RESOURCE "CLOUD"
   DEFINE BUTTON OF oBar RESOURCE "COLORS"

   ACTIVATE DIALOG oDlg CENTERED

return nil
jimmybmp.rc
Code (fw): Select all Collapse
ABOUT     10 "c:\jimmy\bitmaps\no_dpi\about.bmp"
CLEAN32   10 "c:\jimmy\bitmaps\no_dpi\clean32.bmp"
CLEANUP   10 "c:\jimmy\bitmaps\no_dpi\cleanup.bmp"
CLIPBOARD 10 "c:\jimmy\bitmaps\no_dpi\clipboard.bmp"
CLOUD     10 "c:\jimmy\bitmaps\no_dpi\cloud.bmp"
COLORS    10 "c:\jimmy\bitmaps\no_dpi\colors.bmp"
Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Resource Bitmap for Fivewin
Posted: Sun Oct 30, 2022 05:18 AM
hi,
nageswaragunupudi wrote: This is the way we can use these bmp files directly or as resource as it is, without any modifications.
GREAT, this reduce my work :D
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Resource Bitmap for Fivewin
Posted: Sun Oct 30, 2022 10:24 AM
hi,

i like to know how to find out to use 10 instead of BITMAP in RC File to work :?:
is there a Constant for 10 like BITMAP for RC :?:

thx for your work
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Resource Bitmap for Fivewin
Posted: Sun Oct 30, 2022 03:28 PM

RCDATA is 10

For AlphaBitmaps we have to use RCDATA. (better 10)

If your resource compiler complains that BITMAP file is not of a valid format, then change BITMAP to 10 (RCDATA) and try again.

When we specify RCDATA (10), the resource compiler reads the file and stores the contents as a string,

When FWH reads the resource, what all it gets is a string, which can be a pure text or binary data.

FWH ReadImage function checks if the data is a binary data and then if it is an image type and then what image type it is (bmp,ico,cur,jpeg,png,tiff,etc) and then reads it as an image and converts into hBitmap (in some cases it can be meta or other types.) We just leave all that headache to FWH and get back hBitmap (or pImage) or nil.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Resource Bitmap for Fivewin
Posted: Mon Oct 31, 2022 04:51 AM

hi,

thx for Information

greeting,

Jimmy

Continue the discussion