内存不足= image.fromfile() [英] Out of memory in = image.fromfile()

查看:66
本文介绍了内存不足= image.fromfile()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我看到了您的代码并尝试在我的应用中使用,但收到了内存不足"
在这一行:pictureBox1.Image = Image.FromFile(strfn);

我正在使用VB Express,当然语法是不同的.

您能帮我吗,我呆了几天,无法解决这个问题.

谢谢

我的代码VB Express与Northwind.sdf DataBase SQL Compact一起使用

cn.Open()
昏暗的BarImg为Byte()= cmd.ExecuteScalar()
Dim strfn As String ="c:\ papa.jpg"''Convert.ToString(DateTime.Now.ToFileTime())
将Dim fs作为新FileStream(strfn,FileMode.Create,FileAccess.ReadWrite)
fs.Write(barrImg,0,barrImg.Length)
fs.Flush()
fs.Close()
如果File.Exists(strfn)则
FotoPictureBox.Image = Image.FromFile(strfn)

如果

Hi !

I see your code and try to use in my app, but i received an "Out of memory"
at this line: pictureBox1.Image=Image.FromFile(strfn);

I´m Using VB Express and of course the syntaxs are diferent.

Can you please help me, I´m a few days "googling" and I can´t resolve this problem.

Thanks

My code VB Express working with Northwind.sdf DataBase SQL Compact

cn.Open()
Dim barrImg As Byte() = cmd.ExecuteScalar()
Dim strfn As String = "c:\papa.jpg" '' Convert.ToString(DateTime.Now.ToFileTime())
Dim fs As New FileStream(strfn, FileMode.Create, FileAccess.ReadWrite)
fs.Write(barrImg, 0, barrImg.Length)
fs.Flush()
fs.Close()
If File.Exists(strfn) Then
FotoPictureBox.Image = Image.FromFile(strfn)

End If

推荐答案

不要将其发布在快速解答"下-如果您从文章中获得了代码,则底部有一个新消息"按钮该文章的内容,这将导致向作者发送电子邮件.然后会通知他们您希望与他们交谈.
将其发布到此处依赖于他们的下落"并意识到它是针对他们的.
Don''t post this under Quick Answers - if you got the code from an article, then there is a "new message" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.


这篇关于内存不足= image.fromfile()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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