Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 11 total
Thread Background Images in TSurface.wbi.
Wed, Nov 25 2015 6:21 AMPermanent Link

Steve Gill

Avatar

Hi Tim,

I added a 679KB background jpg image to tsurface.wbi.  When the library is compiled tsurface.wbi blows out to over 10MB.

Is there something I can do to make it smaller, besides not including the image. Smile

EWB 2.03 B1

Thanks.

= Steve
Wed, Nov 25 2015 1:33 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< I added a 679KB background jpg image to tsurface.wbi.  When the library is compiled tsurface.wbi blows out to over 10MB.

Is there something I can do to make it smaller, besides not including the image. Smile>>

The easiest way to deal with this is to just assign the image at runtime.  You can do so before the form creation in the application program source:

Application.Surface.Background.Image.Name:='http://www.mysite.com/myimage.jpg';

In general, you should try to keep embedded background images as small as possible, and anything large should be included in the Project Manager as an external file that is bundled with the application.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Nov 25 2015 5:15 PMPermanent Link

Steve Gill

Avatar

<< The easiest way to deal with this is to just assign the image at runtime.  You can do so before the form creation in the application program source:

Application.Surface.Background.Image.Name:='http://www.mysite.com/myimage.jpg';

In general, you should try to keep embedded background images as small as possible, and anything large should be included in the Project Manager as an external file that is bundled with the application. >>

Perfect!  Thanks Tim!!

= Steve
Sat, Dec 5 2015 7:16 PMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Tim,

What if mainform background could be different than the other forms
backgrounds?

Like:

Background.jpg for mainform and background2.jpg for all other forms.
Also would following work?:

Application.Surface.Background.Image.Name:='background.jpg'; //
background.jpg are present in output folder.

I have started using png files for background images, but later decided
to use jpg files because of the size of html file, but compressed html
file did not change much after changing to jpg as i expected?

Regards,
Hüseyin


On 25-11-2015 19:33, Tim Young [Elevate Software] wrote:
> Steve,
>
> << I added a 679KB background jpg image to tsurface.wbi.  When the library is compiled tsurface.wbi blows out to over 10MB.
>
> Is there something I can do to make it smaller, besides not including the image. Smile>>
>
> The easiest way to deal with this is to just assign the image at runtime.  You can do so before the form creation in the application program source:
>
> Application.Surface.Background.Image.Name:='http://www.mysite.com/myimage.jpg';
>
> In general, you should try to keep embedded background images as small as possible, and anything large should be included in the Project Manager as an external file that is bundled with the application.
>
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
Mon, Dec 7 2015 1:53 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< What if mainform background could be different than the other forms backgrounds? >>

Sure, each control (actually, each UI element) in EWB can have a different background, just like with HTML/CSS.

<< Application.Surface.Background.Image.Name:='background.jpg'; //
background.jpg are present in output folder. >>

Yes, that will work.

<< I have started using png files for background images, but later decided to use jpg files because of the size of html file, but compressed html file did not change much after changing to jpg as i expected? >>

Are you specifying the background image at design-time or run-time ?  If the latter (run-time), then the background image won't be included in the HTML.  A background image is only embedded in the HTML loader if you specify it at design-time.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Dec 7 2015 2:23 PMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Tim,

Ok, so..

Application.Surface.Background.Image.Name is not a global setting - but exists for earch form created?
Currently i am specifying background images at design-time, not in runtime. If above works i could set it in runtime in forms oncreate event.

Thanks.

Regards,
Hüseyin


On 07-12-2015 19:53, Tim Young [Elevate Software] wrote:
> << What if mainform background could be different than the other forms backgrounds? >>
>
> Sure, each control (actually, each UI element) in EWB can have a different background, just like with HTML/CSS.
>
> << Application.Surface.Background.Image.Name:='background.jpg'; //
> background.jpg are present in output folder. >>
>
> Yes, that will work.
>
> << I have started using png files for background images, but later decided to use jpg files because of the size of html file, but compressed html file did not change much after changing to jpg as i expected? >>
>
> Are you specifying the background image at design-time or run-time ?  If the latter (run-time), then the background image won't be included in the HTML.  A background image is only embedded in the HTML loader if you specify it at design-time.
>
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
Mon, Dec 7 2015 3:32 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Hüseyin,

<< Application.Surface.Background.Image.Name is not a global setting - but exists for earch form created? >>

That's not what you asked.  You asked if the main form's background image could be different from other forms.

Do you want to change the background image of each form, or do you want to change the background image of the *entire application* (Application.Surface) whenever a specific form is active ?

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Dec 7 2015 3:59 PMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Tim,

Sorry if my question was not clear. What I want is:

Mainform -> background.image('logon.jpg');
All other forms -> background.image('background.jpg');

Hope it's more clear now Smile

Regards,
Hüseyin

On 07-12-2015 21:32, Tim Young [Elevate Software] wrote:
> Hüseyin,
>
> << Application.Surface.Background.Image.Name is not a global setting - but exists for earch form created? >>
>
> That's not what you asked.  You asked if the main form's background image could be different from other forms.
>
> Do you want to change the background image of each form, or do you want to change the background image of the *entire application* (Application.Surface) whenever a specific form is active ?
>
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
Mon, Dec 7 2015 4:33 PMPermanent Link

Raul

Team Elevate Team Elevate

On 12/7/2015 3:59 PM, Hüseyin Aliz wrote:
> Sorry if my question was not clear. What I want is:
>
> Mainform -> background.image('logon.jpg');
> All other forms -> background.image('background.jpg');
>
> Hope it's more clear now Smile

You can do that with the form directly by using "background.image.name"

for example in the form OnCreate :

procedure TForm1.Form1Create(Sender: TObject);
begin
   self.background.image.name := self.name + '.jpg';
end;


Application.Surface.Background is for the application itself (not form)
so you do not need to touch that at all.

Raul
Mon, Dec 7 2015 4:41 PMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Raul,

Thanks for the input Smile

Regards,
Hüseyin

On 07-12-2015 22:33, Raul wrote:
> On 12/7/2015 3:59 PM, Hüseyin Aliz wrote:
>> Sorry if my question was not clear. What I want is:
>>
>> Mainform -> background.image('logon.jpg');
>> All other forms -> background.image('background.jpg');
>>
>> Hope it's more clear now Smile
>
> You can do that with the form directly by using "background.image.name"
>
> for example in the form OnCreate :
>
> procedure TForm1.Form1Create(Sender: TObject);
> begin
>    self.background.image.name := self.name + '.jpg';
> end;
>
>
> Application.Surface.Background is for the application itself (not
> form) so you do not need to touch that at all.
>
> Raul
>
Page 1 of 2Next Page »
Jump to Page:  1 2
Image