From: Philip K on
Hi Everybody,
1. I would like to write a mini-version of PhotoShop for the fun of it
and for occasional photographers who are overwhelmed by PhotoShop itself.
2. I would know how to manipulate the RGB values per pixel if only I
could get them into an array. Are there any tutorials on graphic files such
as JPEG, TIFF, GIF, etc. and how to get their data into C#. (The DRAW
tutorials which I have seen do not cover how to get at the data in these
file formats, insert the new values, and/or change the resolution.)
3. It would also be helpful if there were already in existence Classes
for sliders, wheels, graphic Curve manipulation, and the other tools seen in
PhotoShop. Any suggestions on this as well.
Thanks for any help and suggestions.
Phil


From: Peter Duniho on
Philip K wrote:
> Hi Everybody,
> 1. I would like to write a mini-version of PhotoShop for the fun of it
> and for occasional photographers who are overwhelmed by PhotoShop itself.
> 2. I would know how to manipulate the RGB values per pixel if only I
> could get them into an array. Are there any tutorials on graphic files such
> as JPEG, TIFF, GIF, etc. and how to get their data into C#. (The DRAW
> tutorials which I have seen do not cover how to get at the data in these
> file formats, insert the new values, and/or change the resolution.)

Those file formats are read using the Image.FromFile() method, resulting
in instances of the Bitmap class. From that, you can get the raw data
using the LockBits() method.

> 3. It would also be helpful if there were already in existence Classes
> for sliders, wheels, graphic Curve manipulation, and the other tools seen in
> PhotoShop. Any suggestions on this as well.

You'll have to be more specific. You can't assume everyone is familiar
with the Photoshop UI.

There are a wide variety of UI controls in the Forms and WPF APIs.
Whether any of these would be suitable for your needs, I don't know.

Pete
From: Philip K on
Hi Peter,
Thank you kindly for your swift response.
I should have made my background clearer. I have written many
technical simulations in Fortran, Quick Basic and some C++. I have
recently become somewhat familiar with the C# interface from James Foxall's
"Learn C# in 24 hours". (I must be a slow reader because I can not fathom
the last 14 hours.) I have now started the monster Deitel book on Visual
C# 2008. However, it seems to cover far more than I need.
Can you recommend a medium sized book or tutorial which can carry me
from C++ with a rudimentary knowledge of Classes, instantiations, data
members, function members, etc. to using Visual C# for graphics files.
Thanks again.
Phil


From: Peter Duniho on
Philip K wrote:
> Hi Peter,
> Thank you kindly for your swift response.
> I should have made my background clearer. I have written many
> technical simulations in Fortran, Quick Basic and some C++. I have
> recently become somewhat familiar with the C# interface from James Foxall's
> "Learn C# in 24 hours". (I must be a slow reader because I can not fathom
> the last 14 hours.) I have now started the monster Deitel book on Visual
> C# 2008. However, it seems to cover far more than I need.

Maybe. Is this the book you're talking about:
http://www.amazon.com/Visual-2008-How-Program-3rd/dp/013605322X/

?

That's a _big_ book. 1600 pages!

I'm not familiar with it, but looking at the description, it appears
that it's really not so much a language reference (though at that size
it could easily include one), but a framework reference.

To some extent, you will have to learn .NET as well as C#. Learning the
language is not that hard, especially if you already have C++
experience. But most of the heavy lifting is done in the .NET
framework. In that sense, you might not need to read all 1600 pages of
that book, but you'll definitely need to learn enough about .NET to
understand how it works and how to use it in your code.

At the very least, you'll need to get used to searching the MSDN
documentation and learning how to get around it, so that you can find
the pieces of the framework you need when you need them. Of course,
even better is if you become familiar enough with the framework to
really know at least the more important, fundamental classes and paradigms.

> Can you recommend a medium sized book or tutorial which can carry me
> from C++ with a rudimentary knowledge of Classes, instantiations, data
> members, function members, etc. to using Visual C# for graphics files.

The only C# book I know anything at all about is Jon Skeet's:
http://www.amazon.com/C-Depth-What-need-master/dp/1933988363/

Unfortunately, it's not really a full-blown .NET reference. But at 500
pages, it's certainly more manageable than the 1600 page tome you
mentioned. :) It might be a better way to get your feet wet with the
language, with enough .NET connection to help orient you as you later
develop your knowledge of the framework itself.

There are other C# books out there. I just don't know much about them.
For what it's worth Skeet has also reviewed other books. He's not an
unbiased observer of course, but I believe he does his best to be
objective. You might find his reviews useful in identifying other good
resources:
http://msmvps.com/blogs/jon_skeet/archive/tags/Book+reviews/default.aspx

All that said, as with just about any other programming language,
there's nothing in the language that is specific to graphics processing.
If you want to code in C#, you need to get familiar with the language,
of course. But that doesn't mean you'll automatically be able to move
straight to implementing an image editing program. And I really doubt
that there's _any_ C# or .NET reference that presents the topics
specifically in the context of dealing with graphics processing.

Depending on your experience with C++, you may find it is just as
productive to just dive in and start coding, learning the language as
you go. If you already know the basic concepts behind image processing,
my previous post has as much information as you need to know in order to
get data from a disk file into memory where you can manipulate, other
than the language itself. And you can learn the language part without
thinking about the image processing specifically.

Beyond that, we're happy here to answer specific questions you have
about the language, and to some extent the framework (technically, this
newsgroup really is just for language-specific questions, but I've never
seen it really restricted in that way).

Pete
From: Philip K on
Hi Peter,
Many thanks for your reply.
I'll give Jon Skeet's book a try. If nothing else, it is one third the
size of the Deitel monster. The Deitel book hardly touches on the .NET
framework but seems to concentrate on the theory of programming language.
As per your advice, I will also start browsing the tutorials on the
Microsoft web site for information on the .NET framework.
Right now, I feel overwhelmed.
Many thanks again.
Phil