[Mono-dev] bug with loading a bitmap from an embedded resource?
Hi, I'm new to this list. I'm trying to port a .NET application to Mono. It seems that when I try to load a bitmap from an embedded resource, subsequent operations on that bitmap throw exceptions. For example, assuming I have an embedded resource called TestBitmap.bmp: using System.Drawing: Bitmap bitmap = new Bitmap( this.GetType(), "TestBitmap.bmp"); bitmap.MakeTransparent(Color.Red); // throws OutOfMemoryException or Bitmap bitmap = new Bitmap( this.GetType(), "TestBitmap.bmp"); bitmap.Save("c:\test.bmp"); // throws System.Exception: Unknown Error Has anyone encountered this? I'm running on WinXP. Thanks, Jonathan ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] proper way to upgrade mono installation?
Hi all, I've been working with Mono on Windows for a while, and now I'm transitioning to Linux. I'm fairly new to Linux though. I recently installed Suse 10, which seems to have Mono pre-installed by default. However, it is not the latest version of Mono. What is the easiest way to upgrade a Mono installation? I tried using the Linux installer for x86 from http://www.mono-project.com/Downloads, but it is not clear to me whether this is going to update my existing installation or create a completely new installation. How can I make sure that it updates? Any suggestions much appreciated. -Jonathan ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] proper way to upgrade mono installation?
I was able to install the rpms in mono-1.1.zip and gtk-sharp-1.0.zip using the "rpm -Uvh *.rpm" method. However, when I tried to install rpms in gtk-sharp-2.0.zip, I get the following errors: Preparing...### [100%] file /usr/share/gapi-2.0/art-api.xml from install of gtk-sharp2-gapi-2.8 .0-0.suse100.novell conflicts with file from package gtksourceview-sharp-2_0-0.1 0-9 file /usr/share/gapi-2.0/atk-api.xml from install of gtk-sharp2-gapi-2.8 .0-0.suse100.novell conflicts with file from package gtksourceview-sharp-2_0-0.1 0-9 file /usr/share/gapi-2.0/gdk-api.xml from install of gtk-sharp2-gapi-2.8 .0-0.suse100.novell conflicts with file from package gtksourceview-sharp-2_0-0.1 0-9 (and many more errors of the same format) Can anyone tell me what this means? Thanks, Jonathan On 2/2/06, Miguel de Icaza <[EMAIL PROTECTED]> wrote: > Hello, > > > I've been working with Mono on Windows for a while, and now I'm > > transitioning to Linux. I'm fairly new to Linux though. I recently > > installed Suse 10, which seems to have Mono pre-installed by default. > > However, it is not the latest version of Mono. What is the easiest > > way to upgrade a Mono installation? I tried using the Linux installer > > for x86 from http://www.mono-project.com/Downloads, but it is not > > clear to me whether this is going to update my existing installation > > or create a completely new installation. How can I make sure that it > > updates? > > The installer is for people who want to try Mono quickly. > > If you have SUSE, pick the RPM packages for your specific distribution > from the Downloads page, they come in a zip file with lots of rpms on > it. > > Then upgrade your Mono installation like this: > > rpm -Uvh *.rpm > > (In the directory where you unziped the downloaded file). > > ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] error CS0277 using "protected set"
When compiling the attached file, I get the following compilation error (using mono 1.1.13): error CS0277: Accessor `ProtectedSetter.DerivedClass.Name.set' must be declared public to implement interface member `ProtectedSetter.BaseClass.Name.set' Is this a bug in the Mono compiler? Thanks, Jonathan Test.cs Description: Binary data ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] p/invoke source code
Would someone be kind enough to point me to the source code location in the Mono runtime that does the loading of unmanaged dll/so to support p/invoke functionality? Thanks, Jonathan ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] AppDomain.AppendPrivatePath - change assembly search path at runtime?
Can anyone suggest a means of altering the assembly search path at runtime? I need the ability to load a set of "plugin" assemblies at runtime from a non-default location. My first approach was to add the following to the application's config file: This works on .NET but does not seem to have any effect in Mono. I also tried using AppDomain.AppendPrivatePath(...), but that doesn't seem to work in Mono either. Any ideas would be much appreciated. Thanks in advance, Jonathan ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] System.Drawing.Graphics ignores InterpolationMode
When using the System.Drawing.Graphics class, I set the the property InterpolationMode to InterpolationMode.NearestNeighbor. However, the image rendered to the screen still looks as though it has undergone bilinear interpolation. Running the exact same code on .NET runtime in Windows, the image is clearly not interpolated. Does anyone know if this is a bug (in which case I can submit a bug report), or is the InterpolationMode property simply not yet supported on Linux? Thanks, Jonathan ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] high-resolution timer in Mono?
What is the best way to do accurate high-resolution timing in Mono on Linux? I'm basically looking for the equivalent of QueryPerformanceCounter() on Windows... I looked at System.Environment.TickCount, but it has a resolution that "cannot be less than 500 milliseconds", according to the Mono docs. Is there a high-resolution timer available to Mono? Thanks, Jonathan ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
RE: [Mono-dev] high-resolution timer in Mono?
Here's a link to the Mono docs: http://www.go-mono.com/docs/index.aspx?link=P%3aSystem.Environment.TickCount -Jonathan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alex Chudnovsky Sent: Friday, February 24, 2006 12:00 PM Cc: 'mono-devel mailing list' Subject: Re: [Mono-dev] high-resolution timer in Mono? Jonathan Resnick wrote: > I looked at System.Environment.TickCount, but it has a resolution that > "cannot be less than 500 milliseconds", according to the Mono docs. Can you please provide a link to this? 500 msecs sounds an awfully bad resolution - even Windows got better, is there a reason for this? Also, does it mean that this can apply to Thread.Sleep calls that require number of milliseconds to sleep as a parameter? regards, Alex ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
RE: [Mono-dev] high-resolution timer in Mono?
Thanks Alex. DateTime.Ticks does appear to have much better resolution, however I'm not sure how accurate it is. I'm going to use it for now though, and assume that it is accurate enough for my purposes. If anyone can comment on the accuracy of System.DateTime, I would be interested. -Jonathan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alex Chudnovsky Sent: Friday, February 24, 2006 12:16 PM Cc: 'mono-devel mailing list' Subject: Re: [Mono-dev] high-resolution timer in Mono? Jonathan Resnick wrote: >Here's a link to the Mono docs: > >http://www.go-mono.com/docs/index.aspx?link=P%3aSystem.Environment.Tick >Count > > Perhaps this restriction is intentional here because its an integer, looking at Ticks property for DateTime object - http://www.go-mono.com/docs/index.aspx?link=P%3aSystem.Environment.TickCount It appears to have much better resolution, so you should be able to create DateTime variable with DateTime.Now value and then use difference between current and originally recorded time - no need to use System.Environment for this anyway since it would apply to the whole app rather than benchmarked part of code. Alex ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] System.Diagnostics.Stopwatch code
Thanks Jacek! For now I have decided that DateTime.UtcNow is good enough for my purposes, and I have created an implementation of System.Diagnostics.Stopwatch using System.DateTime as the underlying counter mechanism. I have attached the code, if anyone is interested or if you want to include it Mono (I'm not familiar with the process to formally submit code for Mono), since Mono does not currently have an implementation of this class. Jonathan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jacek Blaszczynski Sent: Saturday, February 25, 2006 6:09 AM To: 'Brian Crowell' Cc: 'mono-devel mailing list' Subject: RE: [Mono-dev] high-resolution timer in Mono? Hello! QueryPerformanceCounter() does not provide that high resolution either (only on 2 or more processor machines resolution is exactly 1 processor tick +/- call cycles) otherwise its the very same as for DateTime.UtcNow (but not DateTime.Now - which takes some extra overhead) for details check blogs on MSDN. Please check the link below for project NGmp on sourceforge.net (it's CIL binding for GMP and MPFR multiprecision numeric libraries) - first files will be released later today - for some utility code which will help you on both Unix/Linux and Windows x86 platforms with very pecise time measurments. Method GetProcessorTicks() in class Utilities implemements P/Invoke wrapper for call to native rdtsc x86 instruction which allows for reading internal x86 processor cycle counter thus providing the ultimate timer resolution which can be thought of. The measurment overhead is roughly 100 processor cycles on .NET after compiling assembly with ngen (Mono --aot option does not work with my code due to some bugs which I am going to file to bugzilla today). http://sourceforge.net/projects/ngmp Cheers Jacek -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Crowell Sent: Friday, February 24, 2006 7:09 PM Cc: 'mono-devel mailing list' Subject: Re: [Mono-dev] high-resolution timer in Mono? Jonathan Resnick wrote: > What is the best way to do accurate high-resolution timing in Mono on > Linux? I'm basically looking for the equivalent of > QueryPerformanceCounter() on Windows... I looked at > System.Environment.TickCount, but it has a resolution that "cannot be > less than 500 milliseconds", according to the Mono docs. Is there a > high-resolution timer available to Mono? Not that I know of, but anyone wanting to develop one would want to implement the new System.Diagnostics.Stopwatch class from .NET 2.0. It was designed to wrap/replace QueryPerformanceCounter(). I guess a lot of people wanted that. --Brian ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list Stopwatch.cs Description: Binary data ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] gtk-dotnet performance
Hello, I tried posting a similar question to the Gtk list but haven't received any response there, so I forgive me for trying my luck here as well. I'm am trying to use gtk-dotnet functionality to copy a System.Drawing.Bitmap to a Gtk.DrawingArea. My first approach was to follow exactly the sample code provided on the mono site (http://www.mono-project.com/GtkSharpNewInVersion2x): protected override bool OnExposeEvent (Gdk.EventExpose args) { using (Graphics g = Gtk.DotNet.Graphics.FromDrawable (args.Window)){ g.DrawImage(...); } return true; } However, I'm finding that the performance of this is unpredictable- if several expose events are generated in quick succession (eg to create an animation), the first will execute quickly ( < 100 msec) but the next 3 or 4 expose events will take much longer (~500 msec). I thought there might be some overhead with re-creating the Graphics object each time, so my second approach was to try using a static intermediate Pixmap as follows: // create a static pixmap Pixmap pixmap = new Pixmap(...); // create a static graphics object Graphics g = Gtk.DotNet.Graphics.FromDrawable (pixmap); protected override bool OnExposeEvent (Gdk.EventExpose args) { // Draw on the static pixmap, through the previously // created Graphics g.DrawImage(...); args.Window.DrawDrawable(..., pixmap, ...); return true; } However, in this case, the performance of g.DrawImage(...) drawing onto a Pixmap is terrible (~ 1 second). Basically, I just need a way to copy a System.Drawing.Bitmap to a Gtk.DrawingArea in a constant and reasonably quick amount of time. I'm not sure what I'm doing wrong, but any ideas would be greatly appreciated. -Jonathan ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list