![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Open Source Projects The place to discuss Basic4ppc open source applications. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Great addition with the colours, will integrate that library into the BS code now so it can use the colour functionality
RE librarys/dlls. SO Express c# can do libraries, but ppc apps cant use libraries? What do u use to create these dlls, is it many steps on top of writing the code to get it as a dll? |
|
|||
|
ok, well Im just reorganising the BSinterface because it needs to be done more logically to go fast. It was drawing pens on the foreground all the time, e.g. in black when a colour wasnt selected
I can implement everything Neil wants from Basic if I have two more things passed to the the library, Firstly a ELEMENTS() array defining the color, spread attributes of particles 0 to MAXELMENTS A rules table rules(MAXELEMENTS,MAXELEMENTS) which has arguments saying what happens when two colored particles meet ChangetoElement, dx, dy is all it will need Ill map out the C# lines in anticipation of Neil working out how to do dlls Ive got a french exam tomorrow so must go and revise now but will catch up with this later. A Bientot! Update- what does that FromArgb( col[i]) change do? Does C# store colours as doubles? Does .Net have a RGB function? Last edited by colin9876 : 12-10-2007 at 06:27 PM. |
|
||||
|
Quote:
Quote:
|
|
|||
|
Yep have a brill way of making it all work simply
the elements array maps the RGB colours to a simple int 0 to MAX u know what color u are(say 5), then u look at the colour pixel ur going to on the screen(say 6) and look up rule(5,6) say then add dx to px, dy to py, and change element type if a different element is specified. Ive got it running in basic, it can react to all fixed objects and all other moving pixels without slowing it down I actually could get rid of the spread parameter by combining it in a rule - but Neil wanted it all the boundry checking can be done by adding a rule in the array too to say e.g. yellow pixels change to black space if they hit a white border codes not long - just not sure about arrays in C#- whats the best way to pass a 2 dimentional array that has 3 arguments rule(m,m)=int,int,int etc Last edited by colin9876 : 12-10-2007 at 07:23 PM. |
|
||||
|
Quote:
Also multiple arbitrary rules per colour may have a bigger performance hit than you assume. If you have some code that works then post it and I will have a look at coding it. |
|
|||
|
Yes sorry arguments wasnt the right word ... how do u say for each rule(1,2) it looks up a few things (sort of like DIM rule(64,64) Type colchange,dy) ... maybe structure is the right word
u only look up one rule, doesnt matter how many there are in the list- only look up the one relevant to the color u are, and the color of the pixel ur going to. Heres a rough guide - Ill give u the exact code next week when Ive got it exactly right bithandler(px(),py(),pcolor(),pspread(),n,rules(,) ) for i=0 to n plot(px(i),py(i),cBlack) newpx=px(i) + our random spreadline newpy=py(i)+1 tocolor=getpixelcolor(newpx,newpy) if tocolor<>cblack thisrule=rule(condense(pcolor(i)) , condense(tocolor)) newpy=py(i) + thisrule.dy pcolor(i)= thisrule.colchange if getpixel(newpx,newpy)<>cBlack then newpx=px(i) newpy=py(i) end end px(i)=newpx py(i)=newpy plot(px(i),py(i),pcolor(i)) Next N.B the condense function just reduces the distinction of the colors so it doesnt need a 64000x64000 rule table. Then I dont need the element look up table either Condense(R,G,B)=((R Mod64)+1)x((G Mod64)+1)x((R Mod64)+1) e.g condense(200,100,0)=4*3*1=12 so 4*4*4 distinct colors, rule table is rules(64x64) Last edited by colin9876 : 12-10-2007 at 09:27 PM. |
|
|||
|
That coding goes right through me. I looked through almost every help thing in the help database and I don't think I understood any of that.
I knew that the way that I had created the program was very glitchy and am glad you are willing to sort it. I find it quite amusing that some members of this forum said that this program couldn't be done. Youz certainly should them! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pocket Chess Database | JamesC | Share Your Creations | 3 | 07-27-2008 04:07 AM |
| Pocket Burning Sand | neilnapier | Questions & Help Needed | 2 | 11-05-2007 07:53 PM |
| print class for pocket pc | tanrikuluahmet | Basic4ppc Wishlist | 1 | 10-01-2007 09:10 AM |
| dzSpy - Spy and Task Manager App - Open Source | dzt | Share Your Creations | 3 | 07-15-2007 05:21 AM |
| Pocket Outlook Object Modell | sloopa | Basic4ppc Wishlist | 12 | 06-02-2007 08:05 AM |