Team,
Is there any way to directly load an image from the web URL to TNxImageColumn or to TNxGraphicColumn ?
For example, I want to load to TNxImageColumn an image from http://www.mysite.com/myimage.jpg
How do I do that? Is there any option to avoid dealing with image lists?
Thanks
Vsevolod
Direct load image from the web to TNxImageColumn or TNxGraphicColumn
Started by IUnknown, Aug 19 2014 01:41 AM
TNxImageColumn direct_load image
5 replies to this topic
#1
Posted 19 August 2014 - 01:41 AM
There are 10 types of people. Those who understand binary and those who don't.
#2
Posted 19 August 2014 - 01:42 AM
[Sorry, the URL in the above example was linked automatically]
There are 10 types of people. Those who understand binary and those who don't.
#3
Posted 19 August 2014 - 11:46 AM
Hi,
ImageColumn is more for icons from TImageList. Maybe you can use Graphic Column instead. Please check this tutorial:
http://dn.bergsoft.n...mn-tutorial.htm
I hope that it will helps.
ImageColumn is more for icons from TImageList. Maybe you can use Graphic Column instead. Please check this tutorial:
http://dn.bergsoft.n...mn-tutorial.htm
I hope that it will helps.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#4
Posted 23 August 2014 - 12:28 PM
Hi Boki,
Thanks for the tutorial.
It seems that
In my case I need a persistent bitmap to be displayed in a column. Here is my quick research:
I wrapped the logic of downloading a bitmap from URL into a simple function
The image seems to load -BUT- when I
If I do not free the object my app leaks memory when I close the form.
I guess we need some techniques here to make the image persistent (something like using
Any ideas?
Thanks for the tutorial.
It seems that
ObjectReferenceproperty stores only an active object. When I free the reference to this object the NextGraphic column also disappears.
In my case I need a persistent bitmap to be displayed in a column. Here is my quick research:
I wrapped the logic of downloading a bitmap from URL into a simple function
DownloadImage(const Url: string): TBitmap;Then I coded as per your suggestion:
var G: TGraphic; Grid.AddRow; Grid.RowHeight[0] := 50; try G := DownloadImage('http://web/my.jpg'); Grid.Cell[0, 0].ObjectReference := G; finally G.Free; end;
The image seems to load -BUT- when I
finally G.Freethe object, it is destroyed and the image is disappeared.
If I do not free the object my app leaks memory when I close the form.
I guess we need some techniques here to make the image persistent (something like using
Assign(Source: TPersistent)) and then let VCL do all garbage collection.
Any ideas?
There are 10 types of people. Those who understand binary and those who don't.
#5
Posted 23 August 2014 - 04:18 PM
Hi,
Maybe before form is closed/destroyed , you simply run trough all objects and release them?
I may add auto-free but what will be if object is interface?
Maybe before form is closed/destroyed , you simply run trough all objects and release them?
I may add auto-free but what will be if object is interface?
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#6
Posted 24 August 2014 - 01:05 AM
Hi Boki,
Thanks for your input. It is always appreciated and carefully reviewed.
This afternoon I found a workaround to my particular case. Tough it has nothing to do with TNxGraphicColumn - but with TNxImageColumn and TImageList instead.
I create ImageList at run-time, then download JPEGs from the web as TBitmap, then
This approach works better in my case and looks like a good coding-style.
Thanks
Vsevolod
Thanks for your input. It is always appreciated and carefully reviewed.
This afternoon I found a workaround to my particular case. Tough it has nothing to do with TNxGraphicColumn - but with TNxImageColumn and TImageList instead.
I create ImageList at run-time, then download JPEGs from the web as TBitmap, then
ImageList.Add(bmp, nil)and finally assign ImageList to grid and set image index.
This approach works better in my case and looks like a good coding-style.
Thanks
Vsevolod
There are 10 types of people. Those who understand binary and those who don't.
Also tagged with one or more of these keywords: TNxImageColumn, direct_load, image
NextSuite v5 - VCL Components (Previous version) →
NextGrid Component →
NextGrid - ability to populate a column with a useable button (only)Started by DbBanjo, 03 Oct 2012 NextGrid, TNxImageColumn and 1 more... |
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users