Resource Bitmap for Fivewin

Resource Bitmap for Fivewin

Postby Jimmy » 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)
Image

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


Re: Resource Bitmap for Fivewin

Postby nageswaragunupudi » Fri Oct 28, 2022 6: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Resource Bitmap for Fivewin

Postby nageswaragunupudi » Sun Oct 30, 2022 4: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: Select all  Expand view
#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: Select all  Expand view
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"
 


Image
Regards

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

Re: Resource Bitmap for Fivewin

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

Re: Resource Bitmap for Fivewin

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

Re: Resource Bitmap for Fivewin

Postby nageswaragunupudi » Sun Oct 30, 2022 3: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Resource Bitmap for Fivewin

Postby Jimmy » Mon Oct 31, 2022 4:51 am

hi,

thx for Information
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 24 guests