另一个“在GDI +中发生一般错误”。错误 [英] Another "A generic error occured in GDI+" Error

查看:76
本文介绍了另一个“在GDI +中发生一般错误”。错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,


我在VB.NET表单上有一些链接到AccessDB的图片框。如果

用户希望打开或编辑图像,我需要将图像保存在临时文件中,然后在任何查看器/编辑器中打开该文件

是用户系统的默认值。我试图做

picturebox1.image.save(filename),这导致GDI +中发生了一般错误




但是,如果我使用未绑定的图片框,请执行

picturebox2.image = image.fromfile(filename1),然后执行

picturebox2.image .save(filename),它运行正常。


我的GDI +错误不是由权限问题引起的,因为我使用了

相同绑定和未绑定图片框的文件夹。它似乎与图片框从数据库中检索图像信息

的方式有关。有办法吗?


问候和TIA,

Lee

解决方案

对于未在Access中保存的图像,可能值得尝试相同的实验。

它在图像信息前面存储一个78字节的标题。不确定这是否导致问题,但希望缩小原因。

" lgbjr" < LG *** @ online.nospam>在消息中写道

news:%2 **************** @ TK2MSFTNGP15.phx.gbl ...

Hello All ,

我在VB.NET表单上有一些链接到AccessDB的图片框。
如果用户希望打开或编辑图像,我需要将图像保存在 viewer / editor是用户系统的默认设置。我试图做
picturebox1.image.save(filename),这会导致GDI +中出现一个通用错误。

但是,如果我使用的话未绑定的图片框,做一个
picturebox2.image = image.fromfile(filename1),然后做一个
picturebox2.image.save(文件名),它工作正常。

我的GDI +错误不是由权限问题引起的,因为我正在使用
绑定和未绑定图片框的相同文件夹。它似乎与图片框从数据库中检索图像信息的方式有关。有没有办法解决这个问题?

问候和TIA,
Lee



嗯,这就是什么我在想,因为未绑定的图片框可以将

图像保存到文件中,但绑定的图片框(对Access)不能。但是,在过去几分钟(在我的原始帖子之后)的

中,我发现存在于AccessDB中的某些图像将保存,而不会出现GDI +错误。


比较将从图片框中保存的图像与不会的图像:


无错误图像:

JPG 150x150(小图)

错误图片:

JPG 1024x768(大图)


我'我将创建一些不同版本的图像,产生

GDI +错误,看看我是否可以弄清楚限制是什么(可能是像素

HxW,也许是文件大小,可能是方面,也许颜色深度等)。只是一个FYI,

AccessDB中的所有图像,除了一个,都会导致GDI +错误。


如果有人遇到此问题,请让我知道(因为我不想

浪费太多时间进行实验,如果已经有一个已知的解决方案!)


" JohnFol" ; <区************ @ WibbleObbble.Com>在消息中写道

news:ya *************** @ newsfe1-gui.ntli.net ...

它可能值得尝试在
Access中未保存的图像上进行相同的实验。它在图像信息前面存储一个78字节的标题。不确定这是否会导致问题,但希望能够缩小原因。
< lgbjr" < LG *** @ online.nospam>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP15.phx.gbl ...

Hello All,
我在VB.NET表单上有一些链接到AccessDB的图片框。
如果用户希望打开或编辑图像,我需要将图像保存在图片框中到临时文件,然后打开该文件,无论
查看器/编辑器是用户系统的默认值。我试图做
picturebox1.image.save(filename),这会导致GDI +中出现一个通用错误。

但是,如果我使用的话未绑定的图片框,做一个
picturebox2.image = image.fromfile(filename1),然后做一个
picturebox2.image.save(文件名),它工作正常。

我的GDI +错误不是由权限问题引起的,因为我正在使用
绑定和未绑定图片框的相同文件夹。它似乎与图片框从数据库中检索图像信息的方式有关。有办法吗?

问候和TIA,
Lee




您可以使用Access来启动图像即,双击该字段。然后,

使用启动的任何查看器(可能是iexplore)将文件保存到新的

位置。

返回Access表格,使用新文件添加一个新行。

执行此操作的原因是需要显示一个已知的好图像,因为您可以在IExplore中看到它(因为您在IExplore中看到它),由

单独的应用程序保存到磁盘,并添加到Access中的新行,可能排除

与记录有任何异常。


" lgbjr" < LG *** @ online.nospam>在消息中写道

新闻:OI ************** @ TK2MSFTNGP10.phx.gbl ...

嗯,那个''我的想法,因为未绑定的图片框可以将
图像保存到文件,但绑定的图片框(到Access)不能。但是,在过去的几分钟内(在我的原始帖子之后),我发现存在于AccessDB中的某些图像会在没有GDI +
错误的情况下保存。

比较将从图片框中保存的图像与不会出现的图像:

无错误图像:
JPG 150x150(小图)
错误图像:JPG 1024x768(一个大图)

我要创建一些不同版本的图像,产生
GDI +错误,看看我是否能弄清楚是什么限制是(可能像素HXW,可能是文件大小,可能是方面,也许是颜色深度等)。只是一个FYI,除了一个之外,AccessDB中的所有图像都会导致GDI +错误。

如果有人之前遇到此问题,请告诉我(因为我不知道)如果已经有一个已知的解决方案,我想浪费太多时间进行试验!)

JohnFol <区************ @ WibbleObbble.Com>在消息中写道
新闻:ya *************** @ newsfe1-gui.ntli.net ...

可能值得尝试对于未在访问中保存的图像进行相同的实验。它在图像信息前面存储一个78字节的标题。不确定这是否会导致问题,但希望能够缩小原因。
< lgbjr" < LG *** @ online.nospam>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP15.phx.gbl ...

Hello All,
我在VB.NET表单上有一些图片框链接到一个
AccessDB。如果用户希望打开或编辑图像,我需要将图片框中的图像保存到临时文件,然后打开该文件,无论用户系统的默认查看器/编辑器是什么。我试图
做picturebox1.image.save(文件名),这会导致GDI +中出现一个通用错误。

但是,如果我使用的话未绑定的图片框,做一个
picturebox2.image = image.fromfile(filename1),然后做一个
picturebox2.image.save(文件名),它工作正常。

我的GDI +错误不是由权限问题引起的,因为我正在使用
绑定和未绑定图片框的相同文件夹。它似乎与图片框从数据库中检索图像信息的方式有关。有没有办法解决这个问题?

问候和TIA,
Lee





Hello All,

I have some pictureboxes on a VB.NET form that are linked to an AccessDB. If
the user wishes to open or edit an image, I need to save the image in the
picturebox to a temp file, then open that file in whatever viewer/editor is
the default for the users system. I tried to do
picturebox1.image.save(filename), which results in "A Generic error occured
in GDI+".

However, if I use an unbound picturebox, do a
picturebox2.image=image.fromfile(filename1), then do a
picturebox2.image.save(filename), it works fine.

My GDI+ error is not being caused by a permissions problem, as I''m using the
same folder for the bound and unbound picturebox. It seems that it has
something to do with the way the picturebox retrieves the image information
from the database. Is there a way around this?

Regards and TIA,
Lee

解决方案

It might be worth trying the same experiment on an image not held in Access.
It stores a 78 byte header in front of the image information. Not sure if
this is causing the problem, but hopefully narrows down the cause.

"lgbjr" <lg***@online.nospam> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...

Hello All,

I have some pictureboxes on a VB.NET form that are linked to an AccessDB.
If the user wishes to open or edit an image, I need to save the image in
the picturebox to a temp file, then open that file in whatever
viewer/editor is the default for the users system. I tried to do
picturebox1.image.save(filename), which results in "A Generic error
occured in GDI+".

However, if I use an unbound picturebox, do a
picturebox2.image=image.fromfile(filename1), then do a
picturebox2.image.save(filename), it works fine.

My GDI+ error is not being caused by a permissions problem, as I''m using
the same folder for the bound and unbound picturebox. It seems that it has
something to do with the way the picturebox retrieves the image
information from the database. Is there a way around this?

Regards and TIA,
Lee



Well, that''s what I was thinking, since the unbound picturebox can save an
image to a file, but the bound picturebox (to Access) can not. However, in
the past few minutes (after my original post), I found that there are
certain images stored in the AccessDB that will save without the GDI+ error.

Comparing an image that will save from the picture box to one that won''t:

No error image:
JPG 150x150 (a small image)
Error Image:
JPG 1024x768 (a big image)

I''m going to create some different versions of the image that produces the
GDI+ error and see if I can figure out what the limitation is (maybe pixel
HxW, maybe file size, maybe aspect, maybe color depth, etc.). Just an FYI,
all of the images in the AccessDB, except one, cause the GDI+ error.

If anyone has run into this before, please let me know (as I don''t want to
waste too much time experimenting if there''s already a known solution!)

"JohnFol" <Ou************@WibbleObbble.Com> wrote in message
news:ya***************@newsfe1-gui.ntli.net...

It might be worth trying the same experiment on an image not held in
Access. It stores a 78 byte header in front of the image information. Not
sure if this is causing the problem, but hopefully narrows down the cause.

"lgbjr" <lg***@online.nospam> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...

Hello All,

I have some pictureboxes on a VB.NET form that are linked to an AccessDB.
If the user wishes to open or edit an image, I need to save the image in
the picturebox to a temp file, then open that file in whatever
viewer/editor is the default for the users system. I tried to do
picturebox1.image.save(filename), which results in "A Generic error
occured in GDI+".

However, if I use an unbound picturebox, do a
picturebox2.image=image.fromfile(filename1), then do a
picturebox2.image.save(filename), it works fine.

My GDI+ error is not being caused by a permissions problem, as I''m using
the same folder for the bound and unbound picturebox. It seems that it
has something to do with the way the picturebox retrieves the image
information from the database. Is there a way around this?

Regards and TIA,
Lee




You could use Access to "launch" the image ie, double click the field. Then,
using whatever viewer is launched (probably iexplore) save the file to a new
location.
Go back into the Access table and add a new row using the new file.
The reason for doing this is it takes a known good image that can be
displayed (because you see it in IExplore), that is saved to disk by a
separate application, and added to a new row in Access, possibly ruling out
anything strange with the record.

"lgbjr" <lg***@online.nospam> wrote in message
news:OI**************@TK2MSFTNGP10.phx.gbl...

Well, that''s what I was thinking, since the unbound picturebox can save an
image to a file, but the bound picturebox (to Access) can not. However, in
the past few minutes (after my original post), I found that there are
certain images stored in the AccessDB that will save without the GDI+
error.

Comparing an image that will save from the picture box to one that won''t:

No error image:
JPG 150x150 (a small image)
Error Image:
JPG 1024x768 (a big image)

I''m going to create some different versions of the image that produces the
GDI+ error and see if I can figure out what the limitation is (maybe pixel
HxW, maybe file size, maybe aspect, maybe color depth, etc.). Just an FYI,
all of the images in the AccessDB, except one, cause the GDI+ error.

If anyone has run into this before, please let me know (as I don''t want to
waste too much time experimenting if there''s already a known solution!)

"JohnFol" <Ou************@WibbleObbble.Com> wrote in message
news:ya***************@newsfe1-gui.ntli.net...

It might be worth trying the same experiment on an image not held in
Access. It stores a 78 byte header in front of the image information. Not
sure if this is causing the problem, but hopefully narrows down the
cause.

"lgbjr" <lg***@online.nospam> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...

Hello All,

I have some pictureboxes on a VB.NET form that are linked to an
AccessDB. If the user wishes to open or edit an image, I need to save
the image in the picturebox to a temp file, then open that file in
whatever viewer/editor is the default for the users system. I tried to
do picturebox1.image.save(filename), which results in "A Generic error
occured in GDI+".

However, if I use an unbound picturebox, do a
picturebox2.image=image.fromfile(filename1), then do a
picturebox2.image.save(filename), it works fine.

My GDI+ error is not being caused by a permissions problem, as I''m using
the same folder for the bound and unbound picturebox. It seems that it
has something to do with the way the picturebox retrieves the image
information from the database. Is there a way around this?

Regards and TIA,
Lee





这篇关于另一个“在GDI +中发生一般错误”。错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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