[Solved] Visual Designer - embedded images with CatchImage

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

[Solved] Visual Designer - embedded images with CatchImage

Post by Keya »

The problem:
When you use PB's Visual Designer and for example create an Image gadget and specify "D:\projects\mydemo\image.bmp" it creates this code:

Code: Select all

LoadImage(#Img_Window_1_0,"D:\projects\mydemo\image.bmp")
Not very portable, and also in the case of program resources itd be nice to embed those

SIMPLE SOLUTION! - it would be great if there was simply an "Embed picture" checkbox option alongside gadgets that have images so that the generated code instead would be something like this:

Code: Select all

CatchImage(#Img_Window_1_0, ?ImageBegin, ?ImageEnd-?ImageBegin)
DataSection
  ImageBegin:
  IncludeBinary("D:\projects\mydemo\image.bmp")
  ImageEnd:
EndDataSection
Thankyou for considering :)
Last edited by Keya on Tue Sep 08, 2015 2:42 pm, edited 1 time in total.
User avatar
mhs
Enthusiast
Enthusiast
Posts: 101
Joined: Thu Jul 02, 2015 4:53 pm
Location: Germany
Contact:

Re: Visual Designer - embedded images with CatchImage (easy!

Post by mhs »

This option already exists.

Look in the Form menu -> Picture Manager, there you can set a checkbox "CatchImage" and also an relative path to the picture.
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Visual Designer - embedded images with CatchImage (easy!

Post by Keya »

GOOD IDEA WASNT IT! ;)
I've never even noticed the Picture Manager before! Thankyou for pointing it out - it's my new favorite IDE feature after Lock checkboxes for resizing :D
Post Reply