jpam Posted May 27, 2008 Posted May 27, 2008 try to slow down your loop Sleep(2) $sprite[$g] = sprite($spritePic, $hdc, 0, 0, 8, 8, 1, 1, 1, $drawx[$g], $drawy[$g]) SpriteToHDC($sprite[$g]) Sleep(2)
eleria Posted May 27, 2008 Author Posted May 27, 2008 (edited) Still exactly the same output whith whatever sleep() values I put and wherever I put them, moreover PNG transparency seem not to work even though I used IrfanView to make sure that the sprite has the good transparency colour(noticeable when sprites are close to each other, some get absorbed by the others) EDIT:Too bad prospeed doesn't handle drawing lines or else the problem of the buggy sprites would already be solved T_T Edited May 27, 2008 by eleria
jpam Posted May 27, 2008 Posted May 27, 2008 i dont see any strange sprites in my example it creates 800 sprites
jpam Posted May 27, 2008 Posted May 27, 2008 have the sprites another function exept drawing to the screen. in your loop u use the SpriteToHDC() function, they become part of the background and after the loop u use DeleteAllSprites() so in my opinion you only use the sprites to draw the picture to the screen. mybe copy pictures to the screen is alot better and faster ! expandcollapse popup#include <Prospeed30.au3> Opt("GUIOnEventMode", 1) HotKeySet("{Esc}","_Exit") GUICreate("Sprite FX", 600, 400) GUISetOnEvent(-3, "_exit") GUISetState() $back = Background("", 0, 0, 600, 400) $Pic = LoadFileImage("msg-24989-1211826305.png") $fx = InitFx($Pic) $total = 800 dim $drawx[$total], $drawy[$total], $sprite[$total] For $g = 0 TO ($total-1) $seedR = random(55,255,1) $seedG = random(55,255,1) $seedB = random(55,255,1) $drawx[$g] = Random(50,500,1) $drawy[$g] = Random(50,300,1) ExchangeRgb($Pic,0,0,$fx,$seedR,$seedG,$seedB) PaintImage($hdc,$drawx[$g],$drawy[$g],8,8,$Pic,0,0,-1) ExchangeRgb($Pic,0,0,$fx,"-"&$seedR,"-"&$seedG,"-"&$seedB) Next While 1 Sleep(500) WEnd Func _exit() FreeAllImages() FreeFx($fx) Exit EndFunc
eleria Posted May 27, 2008 Author Posted May 27, 2008 Assuming I have this: $hdc = GetHDC() CreateBuffer($guiwidth, $guiheight) $IMG_bg = CreateImage(1232, 727)oÝ÷ Øz0q©È±«ÞÓ~0fàsÍú+«b¶ÇÊ'*h²ÆânW¢Æ¯z)í óF~º&iül¢Øb²ÈhºWp¢¹ºÚ"µÍÚ[ÛYH ÔÜÜYYÌ]LÉÝÂÜ ][ÝÑÕRSÛ][[ÙI][ÝËJBÝÙ^TÙ] ][ÝÞÑØßI][ÝË ][Ý×Ñ^] ][ÝÊBÕRPÜX]J ][ÝÔÜ]H ][ÝË BÕRTÙ]Û][ LË ][Ý×Ù^] ][ÝÊBÕRTÙ]Ý]J BÌÍØXÚÈHXÚÙÜÝ[ ][ÝÉ][ÝË BÌÍÔXÈH[ÜÊ ][ÝÜÜÉ][ÝÊBÌÍÙH[] ÌÍÔXÊBÌÍÝÝ[H[H ÌÍÙ]ÞÉÌÍÝÝ[K ÌÍÙ]ÞVÉÌÍÝÝ[K ÌÍÜÜ]VÉÌÍÝÝ[BÜ ÌÍÙÈHÈ ÌÍÝÝ[LJB ÌÍÜÙYYH[ÛJ MKMKJB ÌÍÜÙYYÈH[ÛJ MKMKJB ÌÍÜÙYYH[ÛJ MKMKJH ÌÍÙ]ÞÉÌÍÙ×HH[ÛJ L LJB ÌÍÙ]ÞVÉÌÍÙ×HH[ÛJ LÌJB^Ú[ÙTØ ÌÍÔXË ÌÍÙ ÌÍÜÙYY ÌÍÜÙYYË ÌÍÜÙYYBZ[[XYÙJ ÌÍÚË ÌÍÙ]ÞÉÌÍÙ×K ÌÍÙ]ÞVÉÌÍÙ×K ÌÍÔXËLJB^Ú[ÙTØ ÌÍÔXË ÌÍÙ ][ÝËI][ÝÉ[ÉÌÍÜÙYY ][ÝËI][ÝÉ[ÉÌÍÜÙYYË ][ÝËI][ÝÉ[ÉÌÍÜÙYYB^Ø]Q ÌÍÙ ][ÝÐKÉ][ÝÊBÚ[HBÛY L BÑ[[ÈÙ^] BYP[[XYÙÊ BYQ ÌÍÙ B^][[ But it doesn't o.o
jpam Posted May 27, 2008 Posted May 27, 2008 $newPng = FXToPng(0, $fx, 0, 8, 8, 8*3*8) ExportPng(0,$newPng,"c:\newPng.png")
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now