[Mono-list] LockBits() on Mono 2.2?

Stifu stifu at free.fr
Sat Mar 21 04:13:15 EDT 2009


Nice to hear!
Double buffering should work fine, independently of the way you set the
pixels of your images.

On a side note, I had troubles getting double buffering to work on my own
app, but not due to Mono bugs... In the end, I simply did it manually rather
than with the DoubleBuffered property.


LKeene wrote:
> 
> Okay, I just tried the method outlined here:
> http://www.codeproject.com/KB/GDI-plus/pointerlessimageproc.aspx
> 
> On my Windows XP box it runs on both Microsoft's runtime as well as Mono
> 2.2. Performance seems good. I have to fiddle a bit more and see how
> setting the DoubleBuffered() property affects things, but generally this
> is very encouraging.
> 
> -L
> 
> 
> 
> Stifu wrote:
>> 
>> I haven't yet, but I plan to. I want to replace my unsafe FastBitmap
>> class with it, so my app can be fully managed and get a little speed
>> boost.
>> However, the good thing about the FastBitmap class implementation was
>> that it was handled pretty much exactly like the Bitmap one... Not sure
>> if it can be done with the pointerless method, at least not as is,
>> apparently, because I had a quick look at the class, and it had no
>> SetPixel or GetPixel methods.
>> 
>> 
>> LKeene wrote:
>>> 
>>> Stifu,
>>> have you actually tried the "Fast Pointerless Image Pocessing" method on
>>> CodeProject? I'm implementing it right now and praying there are no
>>> issues. If I can't do fast pixel drawing it's a showstopper for sure. I
>>> want this to work so badly...
>>> 
>>> -L
>>> 
>>> 
>>> 
>>> Stifu wrote:
>>>> 
>>>> Mono being faster than .NET with SetPixel must have been on a
>>>> particular case... I have found a huge performance issue with Mono and
>>>> Get/SetPixel() in a particular situation, making Mono crawl...
>>>> Something instantaneous with .NET can easily take 10 seconds with Mono
>>>> (the perf hit is exponential, too).
>>>> I couldn't make a reduced test case for that one either yet...
>>>> 
>>>> But hey, that aside, I've been happy with Mono too. :p
>>>> 
>>>> 
>>>> Dan Shryock wrote:
>>>>> 
>>>>> On Fri, Mar 20, 2009 at 8:40 AM, LKeene <lionel.keene at gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> I actually intend to use it to draw to a memory bitmap
>>>>>> pixel-by-pixel, rather
>>>>>> than calling SetPixel() each time. Apparently that would be extremely
>>>>>> slow
>>>>>> form what I've read online. The only alternative to Set/GetPixel()
>>>>>> seems to
>>>>>> be declaring an unsafe block and using LockBits(). I'll try to test
>>>>>> the mono
>>>>>> LockBits() implementation today, but assuming that there is indeed a
>>>>>> bug,
>>>>>> does anyone have any other ideas of how to accomplish drawing to a
>>>>>> memory
>>>>>> Bitmap other than SetPixel()? I have a precomputed "Color[,]" that
>>>>>> specifies
>>>>>> the pixels colors.
>>>>> 
>>>>> In a recent project, I had no troubles working with lockbits on Mono
>>>>> 1.9 on linux.
>>>>> In the past, using some older version of Mono (probably 1.1.x or
>>>>> 1.2.x) I had
>>>>> encountered few troubles working with lockbits but they have been
>>>>> resolved in
>>>>> newer Mono releases.
>>>>> 
>>>>> Another thing that I noticed is that calling SetPixel repeatedly on
>>>>> Microsoft's
>>>>> .NET is much slower than calling SetPixel repeatedly on Mono (though
>>>>> lockbits
>>>>> was still faster on both).
>>>>> 
>>>>> HTH
>>>>> 
>>>>> Dan
>>>>> _______________________________________________
>>>>> Mono-list maillist  -  Mono-list at lists.ximian.com
>>>>> http://lists.ximian.com/mailman/listinfo/mono-list
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/LockBits%28%29-on-Mono-2.2--tp22611389p22633724.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list