0% found this document useful (0 votes)
135 views3 pages

How To Use Live Binding To Bind Blob Field To TImage Control - Stack Overflow

The document describes how to bind a blob field containing image data from a TClientDataSet to a TImage control using live bindings in Delphi XE2. While binding a string field to a TEdit control works correctly, binding the graphic/blob field to the TImage control does not. The answer provides the correct code to use for the TBindLink component properties to bind the blob field to the TImage.control's Picture property to display the image.

Uploaded by

nagat4r
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
135 views3 pages

How To Use Live Binding To Bind Blob Field To TImage Control - Stack Overflow

The document describes how to bind a blob field containing image data from a TClientDataSet to a TImage control using live bindings in Delphi XE2. While binding a string field to a TEdit control works correctly, binding the graphic/blob field to the TImage control does not. The answer provides the correct code to use for the TBindLink component properties to bind the blob field to the TImage.control's Picture property to display the image.

Uploaded by

nagat4r
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

Stack Overflow sign up log in

Questions Jobs Tags Users Badges Ask

7 How to use live binding to bind blob field to TImage control?


delphi delphi-xe2 livebindings

I am using Delphi XE2 to write a VCL win32 application. Delphi XE2 support live binding. I load sample
Biolife.xml into a TClientDataSet instance.
I able to bind a TEdit control to dataset's string field: Species Name:

object BindLinkEdit11: TBindLink


Category = 'Links'
SourceMemberName = 'Species Name'
ControlComponent = Edit1
SourceComponent = BindScopeDB1
ParseExpressions = <>
FormatExpressions = <
item
ControlExpression = 'Text'
SourceExpression = 'DisplayText'
end>
ClearExpressions = <>
end

I then trying to bind Graphic field to TImage control:

object BindLinkImage11: TBindLink


Category = 'Links'
SourceMemberName = 'Graphic'
ControlComponent = Image1
SourceComponent = BindScopeDB1
ParseExpressions = <>
FormatExpressions = <
item
ControlExpression = 'Picture'
SourceExpression = 'Value'
end>
ClearExpressions = <>
end

Apparently, it doesn't work. Is that possible to do so?

share improve this question follow

Chau Chee Yang asked


14.5k ● 11 ● 56 ● 120 May 14 '12 at 7:09

edited
May 14 '12 at 8:05

By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
Terms of Service.
1 Answer order by votes

Take a look into the BindLinkVCLProject demo project. There is shown also a binding for the
7 image, so my guess is you need to do it this way (the Self in SourceExpression represents a blob
field):
Category Links
SourceMemberName = 'Graphic'
ControlComponent = Image1
SourceComponent = BindScopeDB1
ParseExpressions = <
item
ControlExpression = 'Picture'
SourceExpression = 'Self'
end>
FormatExpressions = <
item
ControlExpression = 'Picture'
SourceExpression = 'Self'
end>
ClearExpressions = <
item
ControlExpression = 'Picture'
SourceExpression = 'nil'
end>
end

share improve this answer follow

TLama answered
69k ● 15 ● 178 ● 331 May 14 '12 at 8:18

edited
May 14 '12 at 8:23

Your Answer

Body

By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
Terms of Service.
Add picture

Log in

OR

Name

Email

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Post Your Answer

meta chat tour help blog privacy policy legal contact us full site
2020 Stack Exchange, Inc. user contributions under cc by-sa 4.0

By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
Terms of Service.

You might also like