PDA

View Full Version : "Draw Partner!" - My first mouse drawing app


Corey
01-18-2005, 12:10 AM
This is just a simple example I made from a "learning VC++" book. It's nothing at all, yet is jolly good fun though also.

Click Here (http://www.hallucinati.com/draw.zip)

Intrigued
01-18-2005, 12:24 AM
I like it! It's like drawing in Flash but looks more like pre-WinXP icons. (not as, ahem, flashy)

:yes

How many lines of code Corey?

Accomplishement is satisfying!

Corey
01-18-2005, 12:58 AM
Well the application itself is lots of code, i.e. the C++ part but of course that is created by VC++, all I did was add a few lines of code inside a function. It's nothing major, very little code. But to actually do anything useful with it, i.e. create a screen drawing or annotation plug-in for AutoPlay Media Studio is what's tricky.

Slowly but surely I creep up on it though and then one day, just when you least expect it, WHAMMO! I write a plug-in...

I'm just chipping away at it, I tried to approach it from the C++ end before and that crapped out, so now I'm just trying to learn a tiny bit of MFC each day and see where that leads. I have too many ideas for AMS plug-ins. Design time ones too which deal with visual effects and stuff like that, more like Photoshop plug-ins really, but for AMS. Anyhow I ain't making no promises, and I ain't not making no promises. Because everytime I do that with C++ someone end up with a stick in the eye. So I'm just taking it day by day.

Anyhow FWIW the second version took a few more lines of code than the first. It's not a practical drawing app, you could do a zillion times better using the Flash drawing API. But for some reason I enjoy sketching in version 1 with my tablet. It has a nice pointilist look and I like the way the dots get sparser as you sketch faster. I actually managed to do a couple decent sketches in it I forgot to take screencaps though. Next time. :)

P.S. The icon is just the default MFC app icon.

Intrigued
01-18-2005, 01:19 AM
Ah, thanks for the walk-thru!

I did buy a MFC based book earlier last year. However, I decided to work on the plugins for AMS (ans now SF 7!) and Flash MX 2004 it's ActionScripting.

Though, I am sure to come back to such... hopefully right as you release your first "Create Your Own Plugin" C.B.T. CD! :yes

Corey
01-18-2005, 01:37 AM
I wouldn't learn VC++ if it weren't for my gig at IR and my realizing that it's not an option if I wish to be completely relevant.

AMS + Flash will get you more audience approval in a faster time than hand coding any apps will. Here's the thing, people notice what they see, and rapid development of highly stylized materials is not what VC++ is for. That's what AMS and Flash are for.

I'll keep you posted as I learn stuff but suffice to say that unless you are looking to become a software manufacturer, you will get much more benefit out of learning Flash than VC++. Flash skills are timeless, and for my money I can still get more "real world" stuff done in quicker time, with better visual results, using Flash+AMS than I can using VC++. Then again I like Michael MacDonald's singing, so I don't know how much stock you want to put in my opinion.

Brett
01-18-2005, 08:45 AM
Good work, Corey. The think is that once you get this GDI drawing stuff down, then making plugins is relatively easy. And, every plugin that we have made so far uses MFC, so the MFC is by no means a waste.

The most useful classes in MFC in my opinion are not the windowing classes but rather the data classes:

CString, CObject, CArchive, CFile, CObList, etc.

Of course, a good understanding of CWnd is useful too. I found that with C++/MFC it takes a bunch of hacking away at it and then one day - whammo, you start to get it.

If you want to start working on a plugin right away, do this:

1. Get and install the AMS 5.0 SDK
2. Make a copy of the AutoPlay Media Studio 5.0 SDK\Samples\Shape folder to somewhere else on your HD.
3. Open the copied shape project.
4. Find the function CShapeObject :: DrawShape in ShapeObject.cpp.
5. In that function you can do any kind of drawing that you want - just use the hDC that is passed in.

More tips:

- To change the name of the object, look in Shape.cpp
- To change the name of the plugin file that is generated, go to Project > Settings and select the Link tab. There you can change the "output file name".

Anyone with even a bit of C or C++ windows API programming experience can use the above to get started on making your own plugins. After you get started with the above, look up the functions that are used in the SDK reference and keep learning. It really isn't that bad. Give it 2 hours without giving up and you'll get it!

Corey
01-18-2005, 08:51 AM
Oh I've given it 2 hours sir, believe me, that and maaaaaaany more. Sir. Anyhow as to you're comment about "whammo", I KNEW IT! Just like I said, I'll be just whistling along main street without a clue in the world and then suddenlyyyyyy WHAMMO!!! and I'm chunking out the plug-ins like some kind of insane plug-in chunker. :)

Can hardly wait. Fact is I don't understand a thing yet though, I'm just typing what's in the book. :o

Thanks for the tips Brett.

Derek
01-18-2005, 08:58 AM
I nearly wrote this once but deleted it incase i phrased it badly and upset someone. And here i am again deciding to post it anyway.

I am touched! I think its just great that people like Brett [who i am sure is a God to most of us on here] has time in his day to chip in with stuff like that to help others and its like "just who he is". Not at all condescending and always a nice tone to his voice - as it were.

I salute you, Brett.

Corey
01-18-2005, 09:03 AM
If there really is a Brett, then why do bad things happen to good people?

Intrigued
01-18-2005, 09:05 AM
Sooooo you're telling me there is a channnnce! (in so many words)

(Dumb and Dumber)

:yes

Worm
01-18-2005, 09:07 AM
Thanks Corey!

Hot coffee in my sinuses, not a good thing!

I'm with you. I've put in several hours pouring through the sample plugins, and some of it confuses me.


If there really is a Brett, then why do bad things happen to good people?

Intrigued
02-03-2005, 01:22 AM
bump time.

:yes

Corey
02-03-2005, 01:51 AM
Still been plugging away at this but spare time has been scanty of late. Nonetheless I've worked through the first bit of this book. Seeing how Worm developed his last plug-in really woke me up to some new possibilities.

Intrigued
02-03-2005, 09:30 AM
Sounds good!

I was also looking at what Brett had shared with us in this thread. A little insight I thought might help as well.

:yes

azmanar
02-17-2005, 12:11 PM
Hi guys,

My team had been developing our 1st animation project on FLASH for the pass 3 months. The final product is a CD-ROM for slow learners and elementary pupils. Our client is a tuition school.

Now when it comes to COMPILING those animations into full-fledge learning applications, the logical software is definitely DIRECTOR. Well this is what the market FIRMLY believes.

For a small 3-men team on a shoe-string budget and wants to use only LICENSED software, DIRECTOR is sooooooooo expensive for us. And I need expert Director users too ( again very expensive ) . AND the process to compile takes a lot of time ( another high cost ).

So I opted to completely use AM5 Pro to compile all several hundred FLASH movies into a full-blown learning application.

The UNUSUAL part is, I need no EXPERTS to use AM5. The funny part is, I did the compilation myself and I'm not even a TECHIE !! I did the compilation in 2 days flat...

Said to myself, " Woopeedoo.. What an achievement !!! ". So, got myself a big bucket of VANILLA ICE-CREAM to celebrate. hehehe. Lemme see .... Maybe I should start learning how to use the PLUGINS in AM5 Pro.

Bottom-line ............. My client was very satisfied with the CD-ROM and now wants us to develop more products.

Brett
02-17-2005, 12:15 PM
Great testimony, azmanar! We always love to hear about how our software is being used to achieve real-world business goals. Great to have you on board!

Intrigued
02-17-2005, 12:18 PM
Excellente!

I highly recommend other AMS 5 (Pro/Deluxe, Standard can not use the Plugins) users check out the Plugins from I.R.! The SQLite Plugin is an excellent way to have your projects needed data packaged and ready for manipulating!

azmanar
02-17-2005, 01:06 PM
Hi guys,

How did I shorten the learning curve for AM5 Pro?

1. VIEWed all the Video Tutorials which came along it. (Whose voice was it?)
2. REFERed to most examples shown in the Help-files.
3. TESTed most of the sample files on AM5 Pro.

The above were so useful, that I made only a few references in the User Forums.

I have only 2 main wishes from AM5 development team:
1. Object Animations directly from AM5 - such as fly-in , dissolve-in n out.
2. Object Manipulations directly from AM5 - such simple drawing functions.

With the 2 above, we can make PRESENTATIONs which is normally done in MS PowerPoint. Or are those functions already in AM5 but I missed them?

Vanilla Ice-cream, anyone?

Intrigued
02-17-2005, 03:26 PM
Don't forget the printed manuals:

http://www2.ondemandmanuals.com/indigorose

Corey
02-17-2005, 06:04 PM
Hi. Glad to hear you enjoyed the CDs. That's me on there. Anyhow AMS does offer basic manipulation of objects such as size, position, image opacity, etc. So it's not too hard to script transitions. Also forum user Worm has a transition plug-in available at his web site (http://www.warmuskerken.com/warmuskerken_002.htm). Hope that helps. :)

azmanar
02-18-2005, 05:30 AM
Hi guys,

As I guessed, it was Corey as the voice-over. I like the videos and the voice is CRISP - real clear. When are you going to be a part-time Radio Deejay?

Yesterday, I dirtied my hands on AUDIO ACTIONs for hours. Created a Sound Interface for a group of music and sound effects normally used in Training Programs by an NGO. The NGO people like it because the Sound Interface simplifies their task.

Well I noticed that the supported sound files are wav and ogg. When will AMS support MIDI and MP3? It's less heavier.

I bought AMS5 Deluxe. What I saw in Plugin Objects at the INSERT tab are Calendar, Combo Box, Shapes, Thumblist, Progress, WinButton and Slider. Isn't SQL Lite plugin included? Where do I get it?

Thanks.

Corey
02-18-2005, 05:37 AM
Hi. Well we should be releasing some promotional videos at some point, so that's probably my next foray into voiceovers. :) Anyhow you can currently serve MIDI and MP3 via the free windows media player plug-in. You can also play MP3 via Flash as well. The reason for not including MP3 is the crazy lawsuits surrounding the MP3 format by Thompson Media.

To add the SQLite plug-in simply go to "PROJECT > PLUG-INS" in AMS and check the SQLite checkbox then you will notice the SQLite actions appear within your action wizard. Hope that helps. :)

azmanar
02-18-2005, 06:04 AM
Hi Corey,

Your response was lightning fast.

I've downloaded the Media Player Plugin. Thanks for the info.

Also, I finally found the SQL Lite Actions. heheh. An oversight. It was there all the while, as you described.

With SQL Lite , what kind of database can I use? Or is it a build-in database? If it is built-in, the EXE that I publish would have it too?

Thanks

azmanar
02-18-2005, 08:07 AM
Hi,

Ok. I got it.

SQL Lite is an open source database. So AMS5 provide the ACTIONS to talk to the Database.

Since it is a small one, I have to install SQL Lite DB directly to the users PC, that can be packaged with any AMS built applications.

I read some shortcomings about SQL Lite not having the function to alter column of a table. Hmmm.. I guess what I need to do is to design my database properly before using it.

Thanks.

Worm
02-18-2005, 08:12 AM
Check this thread for a utility that will make creating the SQLite DB's alot easier

http://www.indigorose.com/forums/showthread.php?t=8146&highlight=SQLite+Browser

Hi,
I read some shortcomings about SQL Lite not having the function to alter column of a table. Hmmm.. I guess what I need to do is to design my database properly before using it.


It's true that you can't add a field to an existing table. However, there are work-arounds. You can create another table with all of the existing fields, plus the new ones, then insert all records. Or, you can create another table that uses a JOIN to link it back to the other table.

Derek
02-18-2005, 10:02 AM
I'm sure i read that new columns can be added in sqlite3, and since a stable release of v3 has been .. erm, released .. i guess it wont be too long before we have sqlite3 plugin ;)

Edit: Then again, maybe not. ALTER TABLE has been added but that seems to be linked with RENAME TABLE, so i think ALTER TABLE is for renaming. Doesnt actually say anything about columns.
At least renaming without messing about with copying the contents to a new table is a bonus.

Intrigued
02-18-2005, 10:30 AM
I'm sure i read that new columns can be added in sqlite3, and since a stable release of v3 has been .. erm, released .. i guess it wont be too long before we have sqlite3 plugin ;)

Edit: Then again, maybe not. ALTER TABLE has been added but that seems to be linked with RENAME TABLE, so i think ALTER TABLE is for renaming. Doesnt actually say anything about columns.
At least renaming without messing about with copying the contents to a new table is a bonus.
I am too looking forward to a future upgrade to the SQLite Plugin with regards to SQLite 3 out now. I know the DEV team has been hammered the top of this year with the new releases and all coming out with a couple of their products though.

azmanar
02-18-2005, 08:37 PM
Hi,

Thanks for the tip Worm. The browser is downloaded.

Now I have to figure out using AMS and SQLite, on how to create an application that a training administrator can use, to register new participants.

The admin guy can then browse back his list of new participants. Maybe he wants to make some corrections to the records. Add PHOTOS of the participants to their records. Maybe some participants might have to deleted because he entered them twice. Finally publishes chosen records on Words or HTML pages for printing.

No..not for money. The NGO gives free trainings for Social Workers. So, I just want to contribute something to help them in their mission.

Once done ( might take a looooong time to do ), I will share the app out here.