Click here to Skip to main content
15,914,408 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem with databinding to property of interface type. Pin
Member 140473320-Aug-08 21:14
Member 140473320-Aug-08 21:14 
QuestionMicrosoft.SqlServer.Management.Smo problem Pin
hdv21219-Aug-08 2:58
hdv21219-Aug-08 2:58 
AnswerRe: Microsoft.SqlServer.Management.Smo problem Pin
Csharp_Raja19-Aug-08 3:42
Csharp_Raja19-Aug-08 3:42 
GeneralRe: Microsoft.SqlServer.Management.Smo problem Pin
hdv21219-Aug-08 4:08
hdv21219-Aug-08 4:08 
GeneralRe: Microsoft.SqlServer.Management.Smo problem Pin
Csharp_Raja19-Aug-08 4:50
Csharp_Raja19-Aug-08 4:50 
GeneralRe: Microsoft.SqlServer.Management.Smo problem Pin
hdv21219-Aug-08 4:55
hdv21219-Aug-08 4:55 
GeneralRe: Microsoft.SqlServer.Management.Smo problem Pin
Csharp_Raja20-Aug-08 4:34
Csharp_Raja20-Aug-08 4:34 
Questionout of memory:at System.image.fromfile(string filename,boolean useembeddedcolormanagement) Pin
vishnukamath19-Aug-08 2:44
vishnukamath19-Aug-08 2:44 
hai all ,

we used below method for get the image data from database,it is working fine in desktop computers ,but it is not working in laptops.it is showing below error only in laptops.

Error Message:

out of memory:at System.image.fromfile(string filename,boolean useembeddedcolormanagement) at System.Drawing.image.fromfile(String Filename)

Please help me.


public void getimages()
{

bigImgLst_Vendors.Images.Clear();
smallImgLst_Vendors.Images.Clear();
string path;
path = Path.GetDirectoryName(
Assembly.GetExecutingAssembly().GetName().CodeBase);

path = path.Replace("\\bin\\Debug", @"\Transaction\Contacts\Photos");
path = path.Replace("file:\\", "");

string imageDirectoryPath = path;

string[] files = null;

if (Directory.Exists(imageDirectoryPath))
files = Directory.GetFiles(imageDirectoryPath);

if (files != null)
if (files.Length > 0)
for (int i = 0; i <= files.Length - 2; i++)
if (File.Exists(files[i]))
{
//foreach (ListViewItem vcontext in lvw_VendorList.Items)
//{
//if(vcontext.Tag == (files[i].Split('\\'))[files[i].Split('\\').Length - 1])
bigImgLst_Vendors.Images.Add((files[i].Split('\\'))[files[i].Split('\\').Length - 1],
Image.FromFile(files[i]));
smallImgLst_Vendors.Images.Add(
(files[i].Split('\\'))[files[i].Split('\\').Length - 1], Image.FromFile(files[i]));
//}
}

int imageIndex = -1;
int NoImageIndex = 0;

NoImageIndex = bigImgLst_Vendors.Images.IndexOfKey("NoImage.png");

lvw_VendorList.LargeImageList = bigImgLst_Vendors;
lvw_VendorList.SmallImageList = smallImgLst_Vendors;
lvw_VendorList.StateImageList = smallImgLst_Vendors;
foreach (ListViewItem vcontext in lvw_VendorList.Items)
{
if (vcontext.Tag != null)
if (vcontext.Tag.ToString().Trim() != "")
imageIndex = bigImgLst_Vendors.Images.IndexOfKey(vcontext.Tag.ToString());
if (imageIndex != -1)
vcontext.ImageIndex = imageIndex;
else
vcontext.ImageIndex = NoImageIndex;
imageIndex = -1;
}

}
AnswerRe: out of memory:at System.image.fromfile(string filename,boolean useembeddedcolormanagement) Pin
Manas Bhardwaj19-Aug-08 5:16
professionalManas Bhardwaj19-Aug-08 5:16 
QuestionAccess to the file in the same directory Pin
arkiboys19-Aug-08 2:17
arkiboys19-Aug-08 2:17 
AnswerPlease don't repost questions just to bump them to the top. Pin
Pete O'Hanlon19-Aug-08 2:21
mvePete O'Hanlon19-Aug-08 2:21 
GeneralRe: Please don't repost questions just to bump them to the top. Pin
arkiboys19-Aug-08 2:26
arkiboys19-Aug-08 2:26 
RantRe: Please don't repost questions just to bump them to the top. Pin
Paul Conrad19-Aug-08 6:18
professionalPaul Conrad19-Aug-08 6:18 
QuestionHow to create a progressBar? Pin
Admin88719-Aug-08 2:00
Admin88719-Aug-08 2:00 
AnswerRe: How to create a progressBar? Pin
Pete O'Hanlon19-Aug-08 2:06
mvePete O'Hanlon19-Aug-08 2:06 
GeneralRe: How to create a progressBar? Pin
Admin88719-Aug-08 2:11
Admin88719-Aug-08 2:11 
GeneralRe: How to create a progressBar? Pin
Pete O'Hanlon19-Aug-08 2:19
mvePete O'Hanlon19-Aug-08 2:19 
GeneralRe: How to create a progressBar? Pin
Admin88719-Aug-08 2:27
Admin88719-Aug-08 2:27 
GeneralRe: How to create a progressBar? Pin
Pete O'Hanlon19-Aug-08 2:33
mvePete O'Hanlon19-Aug-08 2:33 
AnswerRe: How to create a progressBar? Pin
blackjack215019-Aug-08 2:07
blackjack215019-Aug-08 2:07 
GeneralRe: How to create a progressBar? Pin
V.19-Aug-08 2:54
professionalV.19-Aug-08 2:54 
GeneralRe: How to create a progressBar? Pin
chaiguy133719-Aug-08 15:48
chaiguy133719-Aug-08 15:48 
GeneralRe: How to create a progressBar? Pin
V.19-Aug-08 20:32
professionalV.19-Aug-08 20:32 
GeneralRe: How to create a progressBar? Pin
chaiguy133720-Aug-08 5:18
chaiguy133720-Aug-08 5:18 
AnswerRe: How to create a progressBar? Pin
lisan_al_ghaib19-Aug-08 5:59
lisan_al_ghaib19-Aug-08 5:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.