bitte um hilfe
Übersicht

Sascha081Betreff: bitte um hilfe |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
hallo liebe freunde!
ich bin hier neu und hätte ein problem zu lösen, darum bitte ich um eure hilfe! es geht um folgendes! ich habe eine bitmap erstellt das nur mit der farbe grün gefüllt ist und ein paar blaue tupfer reingemacht (pixel)! jetzt würde ich gerne ein programm machen das die pixel aus der bilddatei ausliest und von allen blauen tupfer(pixel) die es findet die positionen ausgibt! (von jedem blauen pixel seine position mit print ausgeben) BITTE helft mir BITTTTTTE ![]() ![]() ![]() das hier habe ich aus dem beispielcode, was schon sehr gut fürn anfang ist aber wie werte ich das ganze auf um das programm so zu ändern, damit es die aufgabe erfüllt, für die ich es vorgesehen habe! ------------------------------------------------------------------------------------ ; ReadPixel/WritePixel Example ; ---------------------------- Graphics 640,480,16 Print "Press a key to read color values (this may take a few seconds)" WaitKey() ; Load and draw an image on to the screen - can be anything pic=LoadImage("gruen.bmp") DrawImage pic,0,0 ; Initialise an array big enough to fit all the color information of the screen Dim pix(GraphicsWidth(),GraphicsHeight()) ; Use ReadPixel to get all the color information of the screen For y=0 To GraphicsHeight() For x=0 To GraphicsWidth() pix(x,y)=ReadPixel(x,y) Next Next Cls Locate 0,0 Print "Press a key to write pixels (this may takes a few seconds)" Print "Once this has finished, you can then press a key to end the program" WaitKey() For y=0 To GraphicsHeight() For x=0 To GraphicsWidth() WritePixel x,y,pix(x,GraphicsHeight()-y) Next Next WaitKey() ---------------------------------------------------- dankend sascha |
||
![]() |
FluiX |
![]() Antworten mit Zitat ![]() |
---|---|---|
jetzt müsstest du nur noch das Array nach und nach lesen, un schauen welche farbe es hat, ist sie blau dann soll er die koordinaten speicher/ausgeben | ||
traue niemandem!!! |
Matthias |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Hay Sascha. Vieleicht hift dir das hir weiter. Tipp ReadPixelFast geht viel schneller.
Code: [AUSKLAPPEN] Graphics 800,600,32,2
Dim XWert(20000),YWert(20000) ImgX=500:ImgY=500:ZalerMax=40 Image=CreateImage(ImgX,ImgY):SetBuffer ImageBuffer(Image):Color 0,200,0:Rect 0,0,ImgX,ImgY SeedRnd(MilliSecs()) Color 0,0,200:For Zaler=0 To ZalerMax:Plot Rnd(ImgX),Rnd(ImgY):Next:;"Zuffals Punkte" Plot 0,0:LockBuffer;"ImageBuffer schliessen" SuchWert=ReadPixelFast(0,0) For ZX=0 To ImgX-1:For ZY=0 To ImgY-1 Select ReadPixelFast(ZX,ZY):Case SuchWert XWert(Zal)=ZX:YWert(Zal)=ZY:Zal=Zal+1:End Select Next:Next:UnlockBuffer:;"ImageBuffer wieder Öffnen" SetBuffer FrontBuffer():DrawBlock Image,0,0 Color 255,255,0:For Z=0 To Zal:Text 10,Z*14,XWert(Z)+"x"+YWert(Z):Next AppTitle "Drücke ESC" Repeat:Until KeyDown(1)=1:End |
||
Florian |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Code: [AUSKLAPPEN] Graphics 640,480,2,24 img=LoadImage("gruen.bmp") Breit=ImageWidth(Img)-1 Hoch =ImageHeight(Img)-1 a=255 r=0 g=0 b=255 Gesuchte_Farbe=a*$1000000+r*$10000 + g*$100 + b LockBuffer Img For X=0 To Breit For Y=0 To Hoch If ReadPixelFast(X,Y,Img)=Gesuchte_Farbe Then Print "Pixel "+Str$(X)+", "+Str$(Y) EndIf Next Next UnlockBuffer Img WaitKey |
||
Das große BlitzBasic Community Tutorial
Stackmaschine 2.0 |
Sascha081Betreff: danke |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
ich danke euch für die super antworten!!!!
DANKE |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group