Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, dr_panther), 724 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Pixelwerte ??? #348255
11/24/10 14:49
11/24/10 14:49
Joined: May 2010
Posts: 24
Österreich
P
Programm009 Offline OP
Newbie
Programm009  Offline OP
Newbie
P

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 Offline
Junior Member
YellowAfterlife  Offline
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 Offline
User
hopfel  Offline
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!
Re: Pixelwerte ??? [Re: hopfel] #348269
11/24/10 17:19
11/24/10 17:19
Joined: May 2010
Posts: 24
Österreich
P
Programm009 Offline OP
Newbie
Programm009  Offline OP
Newbie
P

Joined: May 2010
Posts: 24
Österreich
Ist zwar ein guter tipp aber leider funktioniert es nicht
ich glaube es liegt an der while-Schleife
aber es ist eh ein wait

Trotzdem danke für die Hilfe.

Re: Pixelwerte ??? [Re: Programm009] #348270
11/24/10 17:22
11/24/10 17:22
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
BMAP* tests = "5.jpg";

jpg verwendet Komprimierung. Dies wird sicherlich nicht beim Schreiben in die bitmap unterstützt, daher der Absturz.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Pixelwerte ??? [Re: Superku] #348274
11/24/10 17:59
11/24/10 17:59
Joined: May 2010
Posts: 24
Österreich
P
Programm009 Offline OP
Newbie
Programm009  Offline OP
Newbie
P

Joined: May 2010
Posts: 24
Österreich
Tut mir leid,
das ist es auch nicht,
ich habe jetzt aber mal alle unwichtigen funktionen mit // nacheinander abgeschaltet,
ich glaube jetzt wirklich es liegt an der while-schleife
sobald ich die ausschalte geht alles wieder

Re: Pixelwerte ??? [Re: Programm009] #348275
11/24/10 18:12
11/24/10 18:12
Joined: May 2010
Posts: 24
Österreich
P
Programm009 Offline OP
Newbie
Programm009  Offline OP
Newbie
P

Joined: May 2010
Posts: 24
Österreich
Ich hab mir grad das alles noch einmal angeschaut und habe endeckt dass ich
nach while(...) ein Semikolon gesetzt habe.
Jetzt funktioniert alles wieder.

Danke leute für die tolle hilfe


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1