Board index » delphi » Is MSDN documentation really any better than BDS2006 Help?

Is MSDN documentation really any better than BDS2006 Help?


2007-03-19 01:00:28 AM
delphi209
About a week ago, Verity Stob had this to say about MSDN help:
Unhelpful Microsoft help denies helpless millions help
www.regdeveloper.co.uk/2007/03/08/msdn_gloom/
I totally agree with Stob's analysis. I am pleased to hear first reports
that Delphi 2007 help is much better than BDS2006, but I always thought
MS help was fairly good. Turns out I may have had the wrong impression,
thinking that volume made up for quality.
As part of a .NET question, I have been looking for a way to get into
the raw pixels in a .NET Bitmap object for some time. Bitmap has
GetPixel and SetPixel but these are way to slow for image processing.
What I wanted was a raw pointer to the image data similar to how
TBitmap.ScanLine does it. I admit I didn't try very hard to find it
because I'd be a fool to use .NET for image processing anyway.
Then I found this discussion of .NET vs Native:
discuss.joelonsoftware.com/default.asp?dotnet.12.463019.42
Someone threw up Paint.NET as an example of a fast C# image processing
application. Well, in reality it is neither fast (3x slower than native
in my tests on the Gaussian filter) nor safe (200 uses of the "unsafe"
keyword, including in filters and it accepts third party plug-ins). It
is not really a pure "sandbox" .NET application.
My interest was in how they solved the raw image bit access problem.
Well, it turns out that BitMap.LockBits.Scan0 gives access to the raw
image bytes. Here is the description for BitMap.LockBits:
"Specifies the attributes of a bitmap image. The BitmapData class is
used by the LockBits and UnlockBits methods of the Bitmap class. Not
inheritable."
Nothing in the MSDN documents gives a clue that it also provides raw
image access. Only if you drill down into the Scan0 documentation do you
really find what is needed. In other words, you need to know what you
are looking for before you can find it.
A focused search for "bitmap raw pixel access" in MSDN doesn't help much
either. It does return a slightly useful result for the Win32 version of
Bitmap but that wasn't what I wanted.
While MSDN has a lot of volume, I am starting to wonder if it is really
all that useful. Volume only makes things harder to find.
 
 

Re:Is MSDN documentation really any better than BDS2006 Help?

James Gibbons writes:
Quote
About a week ago, Verity Stob had this to say about MSDN help:
[...]
While MSDN has a lot of volume, I am starting to wonder if it is really
all that useful. Volume only makes things harder to find.
LockBits method is an overloaded function. Below LockBits these methods
are listed. If you click on the first you will get the description:
Locks a Bitmap into system memory
Below you will find sample code in 3 languages, demonstrating how to
access the raw image data.
Use your favorite Internet search engine to find help quickly (if the
local help doesn't help you) - applies to all IDE's ;-)
Andre
 

Re:Is MSDN documentation really any better than BDS2006 Help?

Andre Kaufmann writes:
<...>
Quote
Below you will find sample code in 3 languages, demonstrating how to
access the raw image data.
First, it takes 5 clicks from Bitmap to get there. Secondly, it calls
Marshal.Copy and when I see the word "Marshal" I think slow unoptimized
code. I believe Paint.NET didn't use that function just for that reason.
Quote

Use your favorite Internet search engine to find help quickly (if the
local help doesn't help you) - applies to all IDE's ;-)

Andre
I do all the time and the results vary depending on how much junk is
present in the search cache. Searching through the results is usually
just as bad as MSDN searches.
I went over to www.java.com, found java.awt.image in a about a minute
and quickly found this:
Raster getData()
Returns the image as one large tile (for tile based images
this will require fetching the whole image and copying the image data over).
James
 

Re:Is MSDN documentation really any better than BDS2006 Help?

On Mar 18, 10:58 pm, James Gibbons <"james at ventek-inc.com">writes:
Quote
Andre Kaufmann writes:

<...>

>Below you will find sample code in 3 languages, demonstrating how to
>access the raw image data.

First, it takes 5 clicks from Bitmap to get there. Secondly, it calls
Marshal.Copy and when I see the word "Marshal" I think slow unoptimized
code. I believe Paint.NET didn't use that function just for that reason.



>Use your favorite Internet search engine to find help quickly (if the
>local help doesn't help you) - applies to all IDE's ;-)

>Andre

I do all the time and the results vary depending on how much junk is
present in the search cache. Searching through the results is usually
just as bad as MSDN searches.

I went over towww.java.com, found java.awt.image in a about a minute
and quickly found this:

Raster getData()
Returns the image as one large tile (for tile based images
this will require fetching the whole image and copying the image data over).

James
Yes you will find alot of performant .Net based applications about
that arent 'CLR Pure' as in truth hacks have to
be employed to get that performance. Quite alot of C++/CLI beginning
to be used under the covers to get arround
performance problems by used mixed code with Native C++ been used in
performance critical areas and even then
you have to be very careful in the design not to get performance
issues.
Recently found MSDN Documentation on CD/DVD/on Hard Drive to not be
all that useful and with how much of a state of flux everything
seems to be continually in. Better to search for things in Online MSDN
or on Google etc :-)
 

Re:Is MSDN documentation really any better than BDS2006 Help?

James Gibbons writes:
Quote
Andre Kaufmann writes:
[...]
First, it takes 5 clicks from Bitmap to get there. Secondly, it calls
Well Bitmap (if you count it as first click), Bitmap.LockBits (second),
LockBits (third).
Quote
Marshal.Copy and when I see the word "Marshal" I think slow unoptimized
code. I believe Paint.NET didn't use that function just for that reason.
Perhaps Paint.NET does directly access the bitmap data by using unsafe
code blocks and pointers ? (haven't checked it)
Quote

I do all the time and the results vary depending on how much junk is
present in the search cache. Searching through the results is usually
just as bad as MSDN searches.
Hm. Google groups search: bitmap raw pixel access .net
Takes me to the thread "Quickes way of setting raw pixel data". One post
holds the link: www.bobpowell.net/lockingbits.htm
(haven't checked the content)
Quote
I went over to www.java.com, found java.awt.image in a about a minute
and quickly found this:
I went there too and searched for "bitmap raw pixel access".
Answer: No results were found for your search. Try refining your search
Quote
[...]
James
Andre
 

Re:Is MSDN documentation really any better than BDS2006 Help?

[snip]
Quote

Hm. Google groups search: bitmap raw pixel access .net
Takes me to the thread "Quickes way of setting raw pixel data". One post
holds the link: www.bobpowell.net/lockingbits.htm
(haven't checked the content)

And to add to it: it is not the MSDN! So it is not the official M$ help.
But I would expect the official help from that vendor to explain it and to
make it findable quick.
I'm not too happy with it either because the examples are often too
complex trying to show too much in one and often the border cases of
functions etc. aren't given. I think I ran into serious trouble 8eating
up kernel memory!) because it was not documented in MSDN that even a
failed call with result code "connection already established" eats up
memory/kernel memory! I think it should have been mentioned for that
function.
Greetings
Markus