Groups | Blog | Home
all groups > dotnet drawing api > march 2006 >

dotnet drawing api : Experiencing problems with Bob Powell's approach


Asfar
3/29/2006 5:07:34 PM
Hi

I am using Bob Powell's approach for converting images to
Format1bppIndexed.

This process is taking more then 2 minutes for 7kb image. The final image
thats created is right but the process takes very long.

Can someone tell me if the conversion really takes that long or if I am
doing something wrong.

Thanks,
-Asfar

Bob Powell [MVP]
3/31/2006 6:10:04 PM
A lot will depend on the size of the image. You should also note that the
article explains how do do the bitmap access with the Marshal class. This is
because I wanted to have an equivalent set of demos for both C# and VB. I
chose this because VB doesn't have the capability to use unsafe methods.

To greatly speed up the conversion process you can replace the calls to
Marshal.ReadByte and Marshal.WriteByte with equivalent unsafe calls written
in C#.

The LockBits article should give you the formulas there.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



[quoted text, click to view]

Asfar
4/3/2006 10:20:52 AM
Thanks Bob.

[quoted text, click to view]

AddThis Social Bookmark Button