Old 05-30-2006, 08:39 PM   #1 (permalink)
Cloud's Hair Spray
 
Join Date: May 2006
Posts: 63
Reputation: 10
Default MFC Question, "Brush" Question

Hey I'm back with a couple programming questions, I'm using c++ in Microsoft Visual Studio .NET 2003, and MFC.

I'm working on my map editor...
Screeny: http://home.fuse.net/Dragonstorm/MapEditor.jpg
Yes the map on the screen stinks, it was a File->Load Test....

First Question.....
With the Dialog Builder how do I set the Min and Max Values of a Slider Control? :rolleyes: I looked through books, I could do it in code, but I was hoping there was a way to do it in the editor....Less to keep track of If i decide to change how it's going to work...

Second Question.....
I have a linear array [Size of image * Size of Image] to hold the height data because you cant create a 2D array with
Code:
char *map = new char [Size][Size];

'Size' being a variable
I'm trying to write the Brush tool to paint with right now and how would I go about finding the pixels to modify if I knew the diameter of the Brush's circle? I want the user to use the "Tool Box" to select the brush width and use a circle with that diameter to paint on my map, I can get the X,Y of the mouse simple but how do i find the points around it?
__________________
Legends of Alterion - Under Development

toast lands butter down, cats land on their feet, what happens when u strap toast to a cat?.....
Math indicates they will hover in quatom indecision...(yet to be tested)
Tocs1001 is offline  
Old 05-31-2006, 03:24 AM   #2 (permalink)
Luigi’s Pizza
 
HopeDagger's Avatar
 
Join Date: May 2006
Location: Ontario, Canada
Posts: 119
Reputation: 10
Send a message via MSN to HopeDagger
Default

Quote:
I have a linear array [Size of image * Size of Image] to hold the height data because you cant create a 2D array with
Code:
char *map = new char [Size][Size];

'Size' being a variable
Sure you can:

Code:
char **map = new char[Size];
for(int a=0; a < Size; a++)
  map[a] = new char[Size];
This makes it significantly easier to find exact coordinates in the array.

Quote:
I'm trying to write the Brush tool to paint with right now and how would I go about finding the pixels to modify if I knew the diameter of the Brush's circle? I want the user to use the "Tool Box" to select the brush width and use a circle with that diameter to paint on my map, I can get the X,Y of the mouse simple but how do i find the points around it?
There's a few good ways to do this. Since I'm no adept at circle-drawing, I refer you to Google instead. Plenty of good material on circle drawing algorithms.
__________________
Gauntlets of Recursion (+5) - My game development journal.
HopeDagger is offline  
Old 05-31-2006, 10:59 AM   #3 (permalink)
Cloud's Hair Spray
 
Join Date: May 2006
Posts: 63
Reputation: 10
Default

an array in an array.....nifty....., I guess i'll try google i was wondering if anyone had any neat tricks for it thanks hope I might rewrite to the array in an array thing..
__________________
Legends of Alterion - Under Development

toast lands butter down, cats land on their feet, what happens when u strap toast to a cat?.....
Math indicates they will hover in quatom indecision...(yet to be tested)
Tocs1001 is offline  
Old 06-11-2006, 05:57 AM   #4 (permalink)
Marios's Mustache Wax
 
Join Date: Jun 2006
Posts: 2
Reputation: 10
Default

If you want plain circles, try looking for Bresenham's circle algorithm. Very fast, and very efficient.
odie5533 is offline  
Old 06-17-2006, 10:19 PM   #5 (permalink)
Detective Kirby
 
punkerdan85's Avatar
 
Join Date: May 2006
Posts: 152
Reputation: 10
Default

How can you put a character array at each element of a character array when each element is supposed to be a single character?
__________________
punkerdan85 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:19 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0
OnRPG, Copyright ©2003-2011, Game Entertainment Enterprises