Auch ne normale Jpg geht nicht. siehe code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim NumPages As Integer
pic_Bild.Image = Image.FromFile("D:\Pinta.jpg")
NumPages = pic_Bild.Image.GetFrameCount(Imaging.FrameDimension.Page)
If NumPages > 0 Then
Dim n As Integer
For n = 1 To NumPages
lstBildNr.Items.Add(n.ToString)
Next
Else
lstBildNr.Visible = False
End If
End Sub
Private Sub lstBildNr_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles _
lstBildNr.SelectedIndexChanged
'pic_Bild.Image.SelectActiveFrame(
' System.Drawing.Imaging.FrameDimension.Page, _
' lstBildNr.SelectedItem - 1)
End Sub
End Class System.Security.SecurityException wurde nicht behandelt.
Message="Fehler bei der Anforderung des Berechtigungstyps" & _
"System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0," & _
"Culture=neutral, PublicKeyToken=b77a5c561934e089."
Source="mscorlib"
StackTrace:
bei System.Security.CodeAccessSecurityEngine.Check(Object demand, _
StackCrawlMark& stackMark, Boolean isPermSet)
bei System.Security.CodeAccessPermission.Demand()
bei System.Drawing.IntSecurity.DemandReadFileIO(String fileName)
bei System.Drawing.Image.FromFile(String filename, Boolean _
useEmbeddedColorManagement)
bei System.Drawing.Image.FromFile(String filename)
bei TiffsTeilen.Form1.Form1_Load(Object sender, EventArgs e)
bei System.EventHandler.Invoke(Object sender, EventArgs e)
bei System.Windows.Forms.Form.OnLoad(EventArgs e)
bei System.Windows.Forms.Form.OnCreateControl()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl()
bei System.Windows.Forms.Control.WmShowWindow(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
bei System.Windows.Forms.Form.WmShowWindow(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& _
m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, _
Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, _
Int32 nCmdShow)
bei System.Windows.Forms.Control.SetVisibleCore(Boolean value)
bei System.Windows.Forms.Form.SetVisibleCore(Boolean value)
bei System.Windows.Forms.Control.set_Visible(Boolean value)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner( _
Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 _
reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(ApplicationContext context)
bei _
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase._
OnRun()
bei _
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Do_
ApplicationModel()
bei _
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Ru_
n(String[] commandLine)
bei TiffsTeilen.My.MyApplication.Main(String[] Args)
bei System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence _
assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.runTryCode(Object userData)
bei _
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuarante_
edCleanup(TryCode code, CleanupCode backoutCode, Object userData)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext _
executionContext, ContextCallback callback, Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext _
executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart() |