From: Peter Olcott on
Setting the ColorDepth EncoderParameter to GDI+
Image::Save()

Status Save(
const WCHAR *filename, const CLSID *clsidEncoder,
const EncoderParameters *encoderParams
);

The only examples that I could find were incorrect examples
asking for correction and receiving none.


From: Peter Olcott on

"Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote in message
news:u6-dnbTpP9sE6RHWnZ2dnUVZ_vadnZ2d(a)giganews.com...
> Setting the ColorDepth EncoderParameter to GDI+
> Image::Save()
>
> Status Save(
> const WCHAR *filename, const CLSID *clsidEncoder,
> const EncoderParameters *encoderParams
> );
>
> The only examples that I could find were incorrect
> examples asking for correction and receiving none.
>

It looks like this is it:
http://msdn.microsoft.com/en-us/library/system.drawing.imaging.encoder.colordepth.aspx

From: Peter Olcott on

"Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote in message
news:h8SdnVSVmNPvDxHWnZ2dnUVZ_qadnZ2d(a)giganews.com...
>
> "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote in message
> news:u6-dnbTpP9sE6RHWnZ2dnUVZ_vadnZ2d(a)giganews.com...
>> Setting the ColorDepth EncoderParameter to GDI+
>> Image::Save()
>>
>> Status Save(
>> const WCHAR *filename, const CLSID *clsidEncoder,
>> const EncoderParameters *encoderParams
>> );
>>
>> The only examples that I could find were incorrect
>> examples asking for correction and receiving none.
>>
>
> It looks like this is it:
>
> http://msdn.microsoft.com/en-us/library/system.drawing.imaging.encoder.colordepth.aspx
>

No this is managed C++, so it is the wrong answer.


From: Joseph M. Newcomer on
Did you look at Image::GetEncoderParameterList? And things it refers to?

You've got to overcome this trauma of seeing things in one language and blanking out with
respect to other languages. The WinMain/OnInitInstance is another example. This is
day-one MFC instruction.

If you see a managed-code interface, there's a good chance there is a non-managed
interface somewhere that does the same thing, so you look for similar names. You'll
usually find something similarly-named in unmanaged code, since GDI+ is unmanaged code.
For example, just look at the GDI+ documentation (note: it has its own problems of being
poor, but it does appear to be reasonably complete). Sometimes the unmanaged interfaces
are a bit clunky, and the managed code interfaces are pretty cosmetic wrappers, but all
the functionality is there.

I typed "GetEncoder" into the MSDN, found a bunch of methods, rejected the ones that were
managed code, ran across Image::GetEncoderParameterList, synced-to-contents, and saw a
couple interesting things. This is a pretty elementary search technique.
joe

On Mon, 1 Mar 2010 22:36:15 -0600, "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote:

>
>"Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote in message
>news:h8SdnVSVmNPvDxHWnZ2dnUVZ_qadnZ2d(a)giganews.com...
>>
>> "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote in message
>> news:u6-dnbTpP9sE6RHWnZ2dnUVZ_vadnZ2d(a)giganews.com...
>>> Setting the ColorDepth EncoderParameter to GDI+
>>> Image::Save()
>>>
>>> Status Save(
>>> const WCHAR *filename, const CLSID *clsidEncoder,
>>> const EncoderParameters *encoderParams
>>> );
>>>
>>> The only examples that I could find were incorrect
>>> examples asking for correction and receiving none.
>>>
>>
>> It looks like this is it:
>>
>> http://msdn.microsoft.com/en-us/library/system.drawing.imaging.encoder.colordepth.aspx
>>
>
>No this is managed C++, so it is the wrong answer.
>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Peter Olcott on

"Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in
message news:ii9qo55tp4n081ap7f2mlo32c87isfks2i(a)4ax.com...
> Did you look at Image::GetEncoderParameterList? And
> things it refers to?
>
> You've got to overcome this trauma of seeing things in one
> language and blanking out with
> respect to other languages. The WinMain/OnInitInstance is
> another example. This is
> day-one MFC instruction.
>
> If you see a managed-code interface, there's a good chance
> there is a non-managed
> interface somewhere that does the same thing, so you look
> for similar names. You'll
> usually find something similarly-named in unmanaged code,
> since GDI+ is unmanaged code.
> For example, just look at the GDI+ documentation (note: it
> has its own problems of being
> poor, but it does appear to be reasonably complete).
> Sometimes the unmanaged interfaces
> are a bit clunky, and the managed code interfaces are
> pretty cosmetic wrappers, but all
> the functionality is there.

Between the terabytes cost and the learning curve cost it
would be probably hundreds fold cheaper for MSDN to simply
publish a concrete example of every little thing (elemental
library operation) in every language. Starting with a
working example takes a few minutes, having to transform
examples in the wrong language by trial and error takes at
least many hours and sometimes several days, Even when this
is completed, one is unsure if the solution is really
correct, and not just something that happens to work some of
the time.

One of the examples that I found concluded that the
transformation from 24-bit to 8-bit bitmaps is not
supported, and instead transformed the 24-bit bitmap to a
GIF, and then the GIF to a bitmap. This became the
recommended best solution, simply because the documentation
is so bad.

>
> I typed "GetEncoder" into the MSDN, found a bunch of
> methods, rejected the ones that were
> managed code, ran across Image::GetEncoderParameterList,
> synced-to-contents, and saw a
> couple interesting things. This is a pretty elementary
> search technique.
> joe
>
> On Mon, 1 Mar 2010 22:36:15 -0600, "Peter Olcott"
> <NoSpam(a)OCR4Screen.com> wrote:
>
>>
>>"Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote in message
>>news:h8SdnVSVmNPvDxHWnZ2dnUVZ_qadnZ2d(a)giganews.com...
>>>
>>> "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote in message
>>> news:u6-dnbTpP9sE6RHWnZ2dnUVZ_vadnZ2d(a)giganews.com...
>>>> Setting the ColorDepth EncoderParameter to GDI+
>>>> Image::Save()
>>>>
>>>> Status Save(
>>>> const WCHAR *filename, const CLSID *clsidEncoder,
>>>> const EncoderParameters *encoderParams
>>>> );
>>>>
>>>> The only examples that I could find were incorrect
>>>> examples asking for correction and receiving none.
>>>>
>>>
>>> It looks like this is it:
>>>
>>> http://msdn.microsoft.com/en-us/library/system.drawing.imaging.encoder.colordepth.aspx
>>>
>>
>>No this is managed C++, so it is the wrong answer.
>>
> Joseph M. Newcomer [MVP]
> email: newcomer(a)flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm