2 registered members (7th_zorro, dr_panther),
724
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Pixelwerte ???
#348255
11/24/10 14:49
11/24/10 14:49
|
Joined: May 2010
Posts: 24 Österreich
Programm009
OP
Newbie
|
OP
Newbie
Joined: May 2010
Posts: 24
Österreich
|
Hi ich habe zwei Fragen 1.) Was ist der Pixlewert der der rückgabewert von Pixel_for_bmap(...) ist
2.) warum hängt sich dieser Code immer auf Schaut zwar nicht ser Professionell aus aber ist ja nur ein versuch
//////////////////////////////////////////////////////////////////// #include <acknex.h> #include <default.c>
//////////////////////////////////////////////////////////////////// Arial#24bi BMAP* tests = "5.jpg"; var pixel; var Testss = 10; var format; PANEL* first_pan = { bmap = "tests"; flags = SHOW; } PANEL* anzeige = { digits(570,460,4,Arial#24bi,1, testss); digits(570,480,4,Arial#24bi,1, x_); digits(570,500,4,Arial#24bi,1, y_); flags = SHOW; }
function main() { wait(-5); var x_ = 1; var y_ = 1; format = bmap_lock(tests,0); if (format >= 565) { while(Testss > 0); { testss -= 1; pixel = pixel_for_bmap(tests, x_, y_); pixel_to_bmap(tests,x_,y_,123); bmap_unlock(tests); x_ += 1; wait(1); } } }
|
|
|
Re: Pixelwerte ???
[Re: Programm009]
#348263
11/24/10 15:56
11/24/10 15:56
|
Joined: Mar 2010
Posts: 75
YellowAfterlife
Junior Member
|
Junior Member
Joined: Mar 2010
Posts: 75
|
pixel_for_bmap returns pixel in specific format (depends on color mode). To retrieve pixels red, green, blue, and alpha, use pixel_to_vec(color,alpha,format,pixel). You may look in the manual for these functions. Examples are included there.
Unfortunately, I've not worked with 3dGS for a while now, but it was fun
|
|
|
Re: Pixelwerte ???
[Re: YellowAfterlife]
#348266
11/24/10 16:37
11/24/10 16:37
|
Joined: Dec 2008
Posts: 605 47°19'02.40" N 8°32'54.67" E...
hopfel
User
|
User
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
|
Du musst bei diesen Pixelfunktionen auch darauf achten, nicht die Bitmapgrösse zu überschreiten. In der Beziehung hat diese Funktion aus Schnelligkeitsgründen keine Überprüfung, wesshalb das zum Crash führt, anstatt zu einer Fehlermeldung. Also das hier solltest du noch einfügen:
if(x_ < tests.width && y_ < tests.height) { pixel = pixel_for_bmap(tests, x_, y_); pixel_to_bmap(tests,x_,y_,123); }
Hilf mir, dir zu helfen!
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|