Author Topic: Re: Questions about PButton and EZ_LoadPicture  (Read 1208 times)

Eric Miller

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Questions about PButton and EZ_LoadPicture
« on: August 05, 2024, 01:48:36 pm »
I've used the EZGUI Designer 5.0 to make an user interface.  I decided to update some bitmaps to a new look only to find out I can't no image us drawn.

I'm using BMP in 24bit mode and the PButton only seems to work with BMPs I first used for my interface design.  If I try to replace the BMP's I get blank boxes instead.  Are the forms responsible for the blank Picture Buttons once their bitmaps are changed?   Is there a way to update the bitmaps on Picture Buttons w/o the images disappearing from them?

Thanks,

Eric

Chris Boss

  • Administrator
  • Jr. Member
  • *****
  • Posts: 60
    • View Profile
Re: Questions about PButton and EZ_LoadPicture
« Reply #1 on: August 05, 2024, 08:06:35 pm »
It is best to use Bitmaps which are 256 color for Picture Button and Picture controls.

EZ_LoadPicture can load 24 or 32 bit images for use with the Canvas control, but you draw them yourself using the EZGUI canvas commands. The Picture Button and Picture controls though do the drawing themselves and 256 color seems to be the most they can handle.


Chris Boss

  • Administrator
  • Jr. Member
  • *****
  • Posts: 60
    • View Profile
Re: Questions about PButton and EZ_LoadPicture
« Reply #2 on: August 05, 2024, 08:09:20 pm »
If you want to change the image on the Picture Button, etc. dynamically using EZ_LoadPicture you must use the EZ_SetImage command to change the image, passing the value returned by EZ_LoadPicture.

This sends a message to the control that a new picture needs to be used. 

Eric Miller

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Questions about PButton and EZ_LoadPicture
« Reply #3 on: August 05, 2024, 10:34:11 pm »
Thanks