| |
|
|
 | Tauscht (blitzschnell) eine bestimmte Farbe REPLCOL& im ganzen Bild in die Farbe NEWCOL&, Idee aus: [...] 
Originalcode: [...]  KompilierenMarkierenSeparieren
proc HPIC.REPLACECOL
PARAMETERS HPIC&,REPLCOL&,NEWCOL&,XX&,YY&
var HPICTMP&=CREATE("hNewPic",XX&,YY&,NEWCOL&)
STARTPAINT HPICTMP&
DRAWPIC HPIC&,0,0;-1,REPLCOL&
ENDPAINT HPICTMP&
STARTPAINT HPIC&
DRAWPIC HPICTMP&,0,0;0
ENDPAINT
DELETEOBJECT HPICTMP&
RETURN HPIC&
| 17.07.2008 ▲ | |
|
|
|
|
 Jac de Lad | Die Idee gefällt mir sehr gut.  |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 17.07.2008 ▲ |
|
|
|
|
 | Gern geschehen, wäre nur schöner wenn man statt "nur" der Dimensione (xx,yy) eine Art "Clippingregion" definieren potuto - zumindest per Rechteck. Mal schauen wie das am reibungslosesten gehen potuto... (um z.B. nur region 10,10 - 20,20 derart zu "bearbeiten") |
|
|
| |
|
|
|
 | Diese Version hier [...] ist besser:
Optional nur 3 Parameter oder 7 Parameter mit Zielbereichangabe. KompilierenMarkierenSeparieren
proc HPIC.REPLACECOL
PARAMETERS HPIC&,REPLCOL&,NEWCOL&,X&,Y&,XX&,YY&
var H&=0
IF %PCOUNT<4
H&=CREATE("hPicCopy",HPIC&)
X&=0
Y&=0
XX&=%BMPX
YY&=%BMPY
DELETEOBJECT H&
ENDIF
H&=CREATE("hNewPic",XX&,YY&,NEWCOL&)
STARTPAINT H&
DRAWPIC HPIC&,0-X&,0-Y&;-1,REPLCOL&
ENDPAINT H&
STARTPAINT HPIC&
DRAWPIC H&,X&,Y&;0
ENDPAINT
DELETEOBJECT H&
RETURN HPIC&
endproc
|
|
|
| |
|
|
|
 Jac de Lad | |
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 17.07.2008 ▲ |
|
|
|
|
 | Sieht dann komplett wie aus? |
|
|
| |
|
|
|
 Jac de Lad | KompilierenMarkierenSeparieren
proc HPIC.REPLACECOL
PARAMETERS HPIC&,REPLCOL&,NEWCOL&,X&,Y&,XX&,YY&
var H&=0
IF %PCOUNT<4
H&=CREATE("hPicCopy",HPIC&)
X&=0
Y&=0
XX&=%BMPX
YY&=%BMPY
DELETEOBJECT H&
ENDIF
H&=CREATE("hNewPic",XX&,YY&,NEWCOL&)
STARTPAINT H&
DRAWPIC HPIC&,0-X&,0-Y&;-1,REPLCOL&
ENDPAINT
DELETEOBJECT HPIC&
RETURN H&
endproc
|
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 17.07.2008 ▲ |
|
|
|
|
 | Ne, diese Lösung funktioniert nicht... gib mal Koordinaten ein...
Mein Testcode: [...] 
Ergibt nach Deinem Code:

statt
 |
|
|
| |
|
|
|
 Jac de Lad | Kann grad nich testen. Das Einzige, was ich anders mache ist doch, dass ich das Handle des temporären Bildes zurückgebe, anstatt den Kram wieder 1:1 zurückzukopieren. Versteh ich jetzt nicht.  |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 17.07.2008 ▲ |
|
|
|
|
 | Gug noch mal an hast nur was übersehen denn ganz so einfach ist der Vorgang leider nicht. |
|
|
| |
|
|
|
 Jac de Lad | Määääääp, du hast ja so recht. 
Und es fehlt eindeutig noch ein profansches "GetWidth" und "GetHeight"... |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 17.07.2008 ▲ |
|
|
|