Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > A question about logic.

Thread Tools

A question about logic.

Posts: n/a
I am trying to create a series of graphics on a single bitmap. So I
can edit any of a series of graphics.

ac, dw are the across and down locations.

I have to invert the bitmap because windows draws graphics up side

acc is the pitch or total width of the whole bitmap.

Each graphic will be 16x16 part of the bitmap.

So I am using a flat array to hold the graphics data.

The logic is that for my down coord I go accross the whole bit map
until I get to the down location.

I go accross current which is the current graphic being edited
skipping the others that are not.

Finally I go across ac to the location being edited which I change the
color of that square.

It works fine for one graphic but when I start adding graphics, the
wrong blocks get changed and when I fill a 16x16 graphic a fraction
1/3 or 1/2 of the previous graphic gets filled not the edited
graphic. Is there some flaw in my logic or much I post more code for
explain better what I am trying to do and the results I am getting.

void bitmap::changeBit(int ac, int dn, BYTE col){

BYTE up = 16-dn;

BYTE num = (up*acc)+(current*16)+ac;

if((num < acc*dwn) || (num > 0)){
bits[num] = col;

Thank you for your time.

Reply With Quote

Thread Tools

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 Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
question row filter (more of sql query question) =?Utf-8?B?YW5kcmV3MDA3?= ASP .Net 2 10-06-2005 01:07 PM
Quick Question - Newby Question =?Utf-8?B?UnlhbiBTbWl0aA==?= ASP .Net 4 02-16-2005 11:59 AM
Question on Transcender Question :-) eddiec MCSE 6 05-20-2004 06:59 AM
Question re: features of the 831 router (also a 924 question) Wayne Cisco 0 03-02-2004 07:57 PM
Syntax Question - Novice Question sean ASP .Net 1 10-20-2003 12:18 PM