CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

drawing to imagecanvas vs image URL

by esthermann » 27 Jun 2014 17:01

I have a 2 part question for you guys, not related to anything that is not working :). It's more of a best practices question. I have several hundred images which need to be displayed in the background of certain pages for my customers.

1. Is it the best practice to have these images stored statically (in an images folder) and then just have TIWImageFile control on my page which resolves the URL in the imagefile?

2. Or would it be better to draw those images directly to a TCanvas when the specific image is called ? (currently in our desktop apps use this methodology)

If #2 is a better answer, which control would be best suited for that?

Thanks in advance. If anyone on the forum wants to weigh in on this, I'd be happy to hear your thoughts.
Esther
esthermann
 
Posts: 171
Joined: 22 Jun 2012 11:17

by Jorge Sousa » 27 Jun 2014 18:14

Hi Esther

the end result will always be an itm tag with src=imageurl, that in Intraweb, as to reside in a physical server folder.

The first method doesn't require any server intervention besides serving the file that matches the url, respecting the cache requeriments.

2. Or would it be better to draw those images directly to a TCanvas when the specific image is called ? (currently in our desktop apps use this methodology)


This is useful when you don't have the image in a file, like an image in a db table, for instance, when we you to use an imagelist, as another instance, or just for commodity.

One way or the other, it is always needed to create a file somewhere, where Intraweb can serve it to the browser.

In all the controls that have TIWCGPicture class, like button images, or TIWCGJQImage, if you load an image using Picture.LoadFromFile / .LoadFromStream, or drawing in the canvas

If Picture.UserCache=False, the default value, the image will be streamed to a file, if doesn't already exists, only once in the web app live, after been installed.

If Picture.UserCache=True, the image will be stream to the sessionusercache, and it's streamed for each session. It's required when we want change the image in ajax/async events.

I hope it helps :)
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58


Return to General

Who is online

Users browsing this forum: No registered users and 7 guests

Contact Us.