|
- // MyClass.cs created with MonoDevelop
- // User: sam at 13:14 04/10/2008
- //
- // To change standard headers go to Edit->Preferences->Coding->Standard Headers
- //
-
- using System;
- using System.Runtime.InteropServices;
- using System.Security;
-
- namespace Pipi
- {
- public class Picture
- {
- private IntPtr _picture;
-
- [DllImport("libpipi.dll", CallingConvention=CallingConvention.Cdecl),
- SuppressUnmanagedCodeSecurity]
- private static extern IntPtr pipi_load(string s);
- public Picture(string s)
- {
- _picture = pipi_load(s);
- }
-
- [DllImport("libpipi.dll", CallingConvention=CallingConvention.Cdecl),
- SuppressUnmanagedCodeSecurity]
- private static extern int pipi_free(IntPtr img);
- ~Picture()
- {
- pipi_free(_picture);
- }
-
- [DllImport("libpipi.dll", CallingConvention=CallingConvention.Cdecl),
- SuppressUnmanagedCodeSecurity]
- private static extern IntPtr pipi_save(IntPtr p, string s);
- public void Save(string s)
- {
- _picture = pipi_save(_picture, s);
- }
-
- [DllImport("libpipi.dll", CallingConvention=CallingConvention.Cdecl),
- SuppressUnmanagedCodeSecurity]
- private static extern int pipi_get_image_width(IntPtr img);
- public int Width
- {
- get { return pipi_get_image_width(_picture); }
- }
-
- [DllImport("libpipi.dll", CallingConvention=CallingConvention.Cdecl),
- SuppressUnmanagedCodeSecurity]
- private static extern int pipi_get_image_height(IntPtr img);
- public int Height
- {
- get { return pipi_get_image_height(_picture); }
- }
- }
- }
|