[
  {
    "Id": "926281",
    "ThreadId": "399259",
    "Html": "\r\n<p>I am trying to stream an image from a zip file to a picturebox by selecting it from a listbox loaded on form load event. I am probably way off here, but here's my code.\r\n</p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre>    <span style=\"color:blue\">Private</span> <span style=\"color:blue\">Sub</span> PicList_SelectedIndexChanged(<span style=\"color:blue\">ByVal</span> sender <span style=\"color:blue\">As</span> <span style=\"color:blue\">Object</span>, <span style=\"color:blue\">ByVal</span> e <span style=\"color:blue\">As</span> System.EventArgs) <span style=\"color:blue\">Handles</span> PicList.SelectedIndexChanged\r\n        <span style=\"color:blue\">Dim</span> Pic <span style=\"color:blue\">As</span> <span style=\"color:blue\">String</span>\r\n        Pic = PicList.SelectedItem.ToString\r\n        <span style=\"color:blue\">Dim</span> MyPic <span style=\"color:blue\">As</span> ZipEntry\r\n        <span style=\"color:blue\">Using</span> zip <span style=\"color:blue\">As</span> ZipFile = ZipFile.Read(Dir &amp; <span style=\"color:#a31515\">&quot;\\Core.zip&quot;</span>)\r\n            <span style=\"color:blue\">If</span> zip.EntryFileNames.Contains(Pic) <span style=\"color:blue\">Then</span>\r\n                <span style=\"color:blue\">For</span> <span style=\"color:blue\">Each</span> MyPic <span style=\"color:blue\">In</span> zip\r\n                    <span style=\"color:blue\">If</span> MyPic.FileName = Pic <span style=\"color:blue\">Then</span>\r\n                        <span style=\"color:blue\">Using</span> MyStream <span style=\"color:blue\">As</span> <span style=\"color:blue\">New</span> ZipOutputStream(ZipEntrySource.Stream)\r\n                            <span style=\"color:blue\">Dim</span> Gr <span style=\"color:blue\">As</span> Image = Image.FromStream(MyStream)\r\n                            PictureBox1.Image = Gr\r\n                        <span style=\"color:blue\">End</span> <span style=\"color:blue\">Using</span>\r\n                        <span style=\"color:blue\">Exit</span> <span style=\"color:blue\">Sub</span>\r\n                    <span style=\"color:blue\">End</span> <span style=\"color:blue\">If</span>\r\n                <span style=\"color:blue\">Next</span>\r\n            <span style=\"color:blue\">End</span> <span style=\"color:blue\">If</span>\r\n        <span style=\"color:blue\">End</span> <span style=\"color:blue\">Using</span>\r\n    <span style=\"color:blue\">End</span> <span style=\"color:blue\">Sub</span>\r\n</pre>\r\n</div>\r\n<p></p>\r\n",
    "PostedDate": "2012-10-13T20:52:47.997-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "926506",
    "ThreadId": "399259",
    "Html": "<p>&nbsp;</p>\r\n<p>System.NotSupportedException was unhandled&nbsp; Message=\"Read\"&nbsp; Source=\"Ionic.Zip\"&nbsp; StackTrace:&nbsp; &nbsp; &nbsp; &nbsp;at Ionic.Zip.ZipOutputStream.Read(Byte[] buffer, Int32 offset, Int32 count) in c:\\DotNetZip\\Zip\\ZipOutputStream.cs:line 1583&nbsp; &nbsp; &nbsp; &nbsp;at System.Drawing.Internal.GPStream..ctor(Stream stream)&nbsp; &nbsp; &nbsp; &nbsp;at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData)&nbsp; &nbsp; &nbsp; &nbsp;at System.Drawing.Image.FromStream(Stream stream)&nbsp; &nbsp; &nbsp; &nbsp;at Ie7Clone.Viewer.PicList_SelectedIndexChanged(Object sender, EventArgs e) in C:\\Users\\Emmery\\Downloads\\VB_NET_Web204585212007\\Ie7Clone\\Forms\\Viewer.vb:line 20&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.ListBox.WmReflectCommand(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.ListBox.WndProc(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.WmCommand(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.WndProc(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.ContainerControl.WndProc(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Form.WndProc(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.NativeWindow.DefWndProc(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.DefWndProc(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.WndProc(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.ListBox.WndProc(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)&nbsp; &nbsp; &nbsp; &nbsp;at System.Windows.Forms.Application.Run(ApplicationContext context)&nbsp; &nbsp; &nbsp; &nbsp;at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()&nbsp; &nbsp; &nbsp; &nbsp;at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()&nbsp; &nbsp; &nbsp; &nbsp;at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)&nbsp; &nbsp; &nbsp; &nbsp;at Ie7Clone.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81&nbsp; &nbsp; &nbsp; &nbsp;at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)&nbsp; &nbsp; &nbsp; &nbsp;at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)&nbsp; &nbsp; &nbsp; &nbsp;at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()&nbsp; &nbsp; &nbsp; &nbsp;at System.Threading.ThreadHelper.ThreadStart_Context(Object state)&nbsp; &nbsp; &nbsp; &nbsp;at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)&nbsp; &nbsp; &nbsp; &nbsp;at System.Threading.ThreadHelper.ThreadStart()&nbsp; InnerException:&nbsp;</p>",
    "PostedDate": "2012-10-14T20:05:16.75-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]