如何装订影像 [英] how to binding a image

查看:94
本文介绍了如何装订影像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在Vs2010,Windows Phone7和Windows Azure Sql数据库中(它也与sql数据库相同.没有混乱).
1)我在Winsow Azure SQL数据库中以EMPLOYEE(Empno int,Ename varchar2,Eimage image)的形式创建了表并插入了值.
2)我创建了一个wcf服务来获取通过LINQ连接到数据库的表.
3)我设计了一个应用程序来动态获取列表中的值.
也为我写的xaml
样本来源:

Hi All,

i am in Vs2010,Windows Phone7 and Windows Azure Sql database(it is also same as sql database..there is no confusion).
1)i created table in winsow azure sql database as EMPLOYEE (Empno int,Ename varchar2,Eimage image) and inserted values also.
2)i created a wcf service to Get the table connected to database through the LINQ.
3)i designed a application to get the values in a list and dynamically.
for the i written xaml also
sample source:

<ListBox x:Name="lstPerson" >
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Empno}"  />
<TextBlock Text="{Binding Ename}" />
<Image Source="{Binding Eimage}"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>



在这里,我没有收到Image,但得到了Ename,empno.所以请大家帮我
如何将图像从数据库导入Windows Phone应用程序?.

在此先感谢,



here i am not getting Image but getting Ename,empno. so please anybody help to me
how get the image from database into my windows phone application ?.

thanks in advance,

推荐答案



查看 StackOverflow讨论 [
Hi,

Check StackOverflow discussion[^] although it''s WPF issue but you are also doing the same thing. Check the answer in given link.

hope it will solve your problem.

thanks
-Amit


我创建了一个业务对象.在此源标签中,我传递了业务对象.
在那个业务对象中,我将图像从二进制转换为全部位图.()
i created a business object. in in this source tag i passed the business object.
inthat business object i converted image from binary to bit map that''s all!.( )


警告!这不是我所知道的话题.话虽这么说

由于您已经成功检索了Ename和Empno,因此在我看来,您没有连接问题.你把那部分做对了,对我来说,那通常是最难的部分.我的第一个问题是,两次列出StackPanel的结束标记是否会导致意外的结果,从而导致图片无法显示?目前尚不清楚为什么会发生这种情况,但是我已经看到了奇怪的事情.我的第二个问题是,您的StackPanel是否包含图像的支架?大小合适吗?如有必要,网页将调整图像的大小,但是我对移动设备一无所知.也许它们不太灵活.有点微妙的想法,您说您没有得到Image,但是您的绑定将Eimage指定为名称.可能是造成问题的简单错字吗?
Warning! This is not a topic I know anything about. That being said,

Since you are successfully retrieving Ename and Empno, it seems to me that you have no connection problems; you got that part right, and for me, that''s usually the hardest part. My first question would be, does having a closing tag for StackPanel listed twice have an unintended result, causing the picture to not appear? It''s not obvious why that would happen, but I''ve seen weirder things. My second question would be, does your StackPanel contain a holder for an image? And is it the right size? A web page will resize the image, if necessary, but I know nothing about mobile devices. Maybe they''re a bit less flexible. As a little subtle thought, you say you''re not getting Image, but your binding specifies Eimage as the name. Could it be a simple typo that''s causing the problem?


这篇关于如何装订影像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆