Click here to Skip to main content
15,914,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Terry O'Nolley22-Sep-03 12:58
Terry O'Nolley22-Sep-03 12:58 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Joaquín M López Muñoz22-Sep-03 10:33
Joaquín M López Muñoz22-Sep-03 10:33 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
act_x22-Sep-03 11:02
act_x22-Sep-03 11:02 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Jason Henderson22-Sep-03 11:05
Jason Henderson22-Sep-03 11:05 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Terry O'Nolley22-Sep-03 13:29
Terry O'Nolley22-Sep-03 13:29 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Jason Henderson22-Sep-03 16:18
Jason Henderson22-Sep-03 16:18 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Terry O'Nolley22-Sep-03 16:41
Terry O'Nolley22-Sep-03 16:41 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Jason Henderson22-Sep-03 17:01
Jason Henderson22-Sep-03 17:01 
Terry O`Nolley wrote:
But what about window resizing?

Use StretchBlt to resize both the on screen table graphic and the off screen template graphic, assuring that they remain the same size.

Most Element tables aren't arranged in a square grid pattern. The look more like this: http://www.webelements.com/[^]

It's easy to draw X elements with i rows and j columns, but its not so so easy to draw 2 on one row, 4 on another, etc.


Terry O`Nolley wrote:
Although there is a certain elegance when you get down to determining which element was clicked on, the building the infrastructure for such elegance is worse than using a slightly less tricky technique.

You have one offscreen DC containing the template bitmap. If the screen and template are the same size, all you have to do is call dcOffScreen.GetPixel(x,y) to get the color at the point clicked. If it's black, then they didn't click on an element. If its not black, find the element with that color and there you have it. The hardest part would be reading the colors into your element object, but that could be hard coded if need be.

"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
Jason Henderson
blog | articles

GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Terry O'Nolley22-Sep-03 17:14
Terry O'Nolley22-Sep-03 17:14 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
b_girl23-Sep-03 3:09
b_girl23-Sep-03 3:09 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Jason Henderson25-Sep-03 9:04
Jason Henderson25-Sep-03 9:04 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
b_girl25-Sep-03 9:24
b_girl25-Sep-03 9:24 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Jason Henderson25-Sep-03 9:48
Jason Henderson25-Sep-03 9:48 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
b_girl25-Sep-03 9:53
b_girl25-Sep-03 9:53 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Jason Henderson25-Sep-03 10:48
Jason Henderson25-Sep-03 10:48 
Questionwhat is the ? thingy called? Pin
keegan22-Sep-03 8:27
keegan22-Sep-03 8:27 
AnswerRe: what is the ? thingy called? Pin
ZoogieZork22-Sep-03 8:32
ZoogieZork22-Sep-03 8:32 
AnswerRe: what is the ? thingy called? Pin
Michael Dunn22-Sep-03 9:04
sitebuilderMichael Dunn22-Sep-03 9:04 
GeneralRe: what is the ? thingy called? Pin
keegan22-Sep-03 9:15
keegan22-Sep-03 9:15 
GeneralRe: what is the ? thingy called? Pin
Michael Dunn22-Sep-03 11:03
sitebuilderMichael Dunn22-Sep-03 11:03 
AnswerRe: what is the ? thingy called? Pin
22-Sep-03 9:19
suss22-Sep-03 9:19 
GeneralMSXML Pin
act_x22-Sep-03 8:14
act_x22-Sep-03 8:14 
GeneralRe: MSXML Pin
JWood22-Sep-03 9:21
JWood22-Sep-03 9:21 
GeneralRe: MSXML Pin
act_x22-Sep-03 9:32
act_x22-Sep-03 9:32 
GeneralRe: MSXML Pin
JWood22-Sep-03 10:03
JWood22-Sep-03 10:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.