Talk:Bitmap: Difference between revisions

added two header sections to put the TOC in the proper place.
(added two header sections to put the TOC in the proper place.)
 
Line 1:
==some examples don't fulfill the task==
It seems quite a few of the examples don't fulfill the task. The task asks for 3 procedures, Create, Get, and Set, but only two or three of the examples have them.
 
==unclear on "get the color"==
Also, I'm kind of unclear on the "get the color" procedure. For example, C++ returns a boolean? I thought the point was to return the pixel's color? --[[User:Mbishop|Mbishop]] 08:02, 20 February 2009 (UTC)
: The boolean return value indicates success. The C++ GetPixel routine returns the color by modifying three variables the caller passes into it. The alternative would be to return a special data type, or a packed integer. Many C++ environments have the special datatype, such as Win32's [http://msdn.microsoft.com/en-us/library/dd162939(VS.85).aspx RGBTRIPLE], [http://msdn.microsoft.com/en-us/library/dd162938(VS.85).aspx RGBQUAD] and [http://msdn.microsoft.com/en-us/library/dd183449(VS.85).aspx COLORREF], but it's not strictly C++, and they're not really necessary. And returning a packed integer would require the caller to do their own processing. Using pointers or references as arguments is a common idiom in C++. However, I can add another C++ example that provides those three types as arguments to SetPixel and return values for GetPixel, and throws exceptions on failure instead of returning false. --[[User:Short Circuit|Short Circuit]] 09:00, 20 February 2009 (UTC)