HighTechTalks DotNet Forums  

Region to Bitmap - Form Slow to Show

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss Region to Bitmap - Form Slow to Show in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Phil Jones
 
Posts: n/a

Default Region to Bitmap - Form Slow to Show - 11-01-2006 , 09:25 PM






Bob. Thanks for your article on converting a bitmap to a region
(http://www.bobpowell.net/region_from_bitmap.htm).

I've implemented that method - and I find that when I apply the region to
the form it takes a long time for the form to then reveal itself (as in 2 -
5 seconds).

I assume this is because the region is quite complex, having been
constructed with a lot of little data-points. The picture is no more (in
fact less) complex the triumph motorcycle sample on your article....so I was
wondering. Is there some way to optimize this - or speed it up - or other
general work arounds if it is just a slow thing?

Thanks Bob.

PHiL - NZ



Reply With Quote
  #2  
Old   
Bob Powell [MVP]
 
Posts: n/a

Default Re: Region to Bitmap - Form Slow to Show - 11-02-2006 , 01:47 PM






This can be speeded up enormously by using LockBits to get the pixels rather
than GetPixel which is horribly slow.

--
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.



"Phil Jones" <nospam> wrote

Quote:
Bob. Thanks for your article on converting a bitmap to a region
(http://www.bobpowell.net/region_from_bitmap.htm).

I've implemented that method - and I find that when I apply the region to
the form it takes a long time for the form to then reveal itself (as in
2 - 5 seconds).

I assume this is because the region is quite complex, having been
constructed with a lot of little data-points. The picture is no more (in
fact less) complex the triumph motorcycle sample on your article....so I
was wondering. Is there some way to optimize this - or speed it up - or
other general work arounds if it is just a slow thing?

Thanks Bob.

PHiL - NZ




Reply With Quote
  #3  
Old   
Phil Jones
 
Posts: n/a

Default Re: Region to Bitmap - Form Slow to Show - 11-04-2006 , 12:53 AM



Ahh! Thanks for that.


"Bob Powell [MVP]" <bob (AT) _spamkiller_ (DOT) bobpowell.net> wrote

Quote:
This can be speeded up enormously by using LockBits to get the pixels
rather than GetPixel which is horribly slow.

--
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.



"Phil Jones" <nospam> wrote in message
news:eVRENai$GHA.1556 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
Bob. Thanks for your article on converting a bitmap to a region
(http://www.bobpowell.net/region_from_bitmap.htm).

I've implemented that method - and I find that when I apply the region to
the form it takes a long time for the form to then reveal itself (as in
2 - 5 seconds).

I assume this is because the region is quite complex, having been
constructed with a lot of little data-points. The picture is no more (in
fact less) complex the triumph motorcycle sample on your article....so I
was wondering. Is there some way to optimize this - or speed it up - or
other general work arounds if it is just a slow thing?

Thanks Bob.

PHiL - NZ






Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.