|
-
Mar 26th, 2006, 05:58 AM
#1
Thread Starter
New Member
Save picturebox.image
Hi,
maybe it is silly problem, but I really have not found any similar problem resolved here.
I have following code
PictureBox2.Image.Save("c:\image2.jpeg",system.Drawing.Imaging.ImageFormat.Jpeg)
and following error...
A generic error occurred in GDI+.
This picture is loaded into the picturebox (picturebox.load) when the app is running
But if I set the picturebox.image property before I run the app then it works and saves correct...????
Thanks for any help
-
Mar 26th, 2006, 06:48 AM
#2
Re: Save picturebox.image
Welcome to the Forums.
That sounds like its being locked since its in use during runtime. If you set the property in the property grid at design time then it copies the image to its resources so no lock will be lace, I believe.
Save it as a different filename if you need to set it at runtime..
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 26th, 2006, 09:41 AM
#3
Thread Starter
New Member
Re: Save picturebox.image
I'm affraid that it is not a problem of the filename. It is obviously the kind problem which can be caused by anything ...
-
Mar 26th, 2006, 12:44 PM
#4
Re: Save picturebox.image
You didnt get it, th name your specifing is the same as the image file dynamically linked to the picturebox at runtime. This will retain a lock on the file that will not allow you to overwrite the file since its in use.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 26th, 2006, 02:50 PM
#5
Thread Starter
New Member
Re: Save picturebox.image
Well, I am a newbie, but not that much ....Of course I load the file and save it in different destinations. Is that problem too?
I just wanted to know if this is some kind of standart problem or it is something "special".
Thanks for help
-
Mar 26th, 2006, 03:31 PM
#6
Re: Save picturebox.image
Its a standard issue because the file will always be in use when assigned dynamically at run time.
A workaround would be to use a temp copy of the file and when you need to save there should be no problem saving to the real name and location. Then make a new temp copy and reassign the image.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|