Jump to content

prospeed


jpam
 Share

Recommended Posts

Above script creates empty bitmap and fill it half with blue and half with red

in the loop it looks if an pixeldata has the value of the blue color

if it finds one, it change it value to white

i dont do any with the created $ArrayData[$i]

that part is for you :)

Edited by jpam
Link to comment
Share on other sites

  • Replies 511
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I've take $arraydata and modify some pixels values.

thenI did a _arraytostring($arraydata,"") to make a long string

so i copy paste your function drawsprite() to generate a bitmap from the string ...

$bitmap3 = DrawSprite(1,_ArrayToString($ArrayData,""),$width,$height)

CopyArray($hdc, 300, 0, $bitmap3)

then a big crash

the same effect if I do

CopyArray($hdc, 300, 0, $arraydata)

i'm really dumb

Link to comment
Share on other sites

CopyArray($hdc, 300, 0, $bitmap3) , you cant copy bitmapdata with "CopyArray" only arraydata !

But why turn it in to a long string with "_arraytostring"

You can modify some pixels directly in the picture array

copy the Array back to an empty bitmap "CopyArray($empty_bitmap, 300, 0, $array)"

And save it with "SaveExtImage($empty_bitmap, "C:\new_bitmap.bmp", 0, 10)"

The routine is slow , but if you know the offset of the colordata in the array

you can make it allot faster !

i am dumb too !

Most of this stuff i learned from frank, he is a real code magician

Edited by jpam
Link to comment
Share on other sites

InitExtFX() generates image-datas of an image. The result of this function is a handle to following structure:

0 LONG Size of these structure without pointer to memory (40 Bytes)

4 LONG biWidth, width if the image

8 LONG biHeight, height of the image

12 WORD biPlanes, always 1

14 WORD biBitCount, always 24

16 LONG biCompression, always BI_RGB

20 LONG biSizeImage, size of image-datas in bytes

24 LONG biXPelsPerMeter, not fpr user-interest

28 LONG biYPelsPerMeter, not fpr user-interest

32 LONG biClrUsed, not for user-interest

36 LONG biClrImportant, not for user-interest

40 LONG Pointer of a memory with imagedatas

Edited by Nordwind
Link to comment
Share on other sites

posted new fx-imagedemo.exe

posted new source--imagedemo.au3

posted new prospeed.udf

Fixed some bugs that the demo did crash at start.

Fixed aftertitles not shown on some computers.

Added "#RequireAdmin" in the script for vista users, don't know if it helps.

Cannot test it myself , i dont have vista.

All new effects are added incl 2 waterdemos.

and has now screen buffers for WM_PAINT.

http://prospeed-jan.xprofan.com/

Edited by jpam
Link to comment
Share on other sites

i use v3.2.11.0 (beta)

Seems that v3.2.10.0 allready has Declared WM_PAINT

Comment this line in prospeed udf "Global Const $WM_PAINT = 0x000F"

It's also declared in WindowsConstants.au3 in v3.2.11.0 and v3.2.11.1 (beta)

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

New Function "MergeImagePng"

Merge The Image data From 2 Png Image files

Combined With MergeChannelPng you can get a morph Effect with Png images

Updated FX-ImageDemo.exe

Updated fx-mergeChannelpng.exe and renamed to "fx-mergeimagepng.exe"

New WaterDemo with Mask image "fx-waterwithmask.exe"

added source files

Updated New Prospeed.dll and Udf file

http://prospeed-jan.xprofan.com/

Link to comment
Share on other sites

I just wanted to test source--mergeimagepng.au3 and source--paintpng-with-background-buffering.au3. There was still the error with

Global Const $WM_PAINT = 0x000F

and after i commented it out, autoit just crashed directly when i started it (windows said something like autoit3 has just caused an error and must quit).

Note: I tested it here under windows 2k because at this place is no xp.

Is this UDF win2k compatible?

are you sure that you use the lastest autoit version?

Except that i can't get it to work, I really like your udf. The demos look great :)

EDIT: I just realized that you /fileinstalled/ some files that arent included in the downloads.

Anyway, i tried to launch the compiled version and it gave me the same windows-error, as before. seems like your dll does really not work under 2k.

EDIT2: Now thats strange: after i ran your exe the first time both exe and au3 are working O_O

Edited by suppa2
Link to comment
Share on other sites

When you try to run an source file without Image files, then it will crash !

Run the compiled version first , to get the Images or use your own Image files

i included the source files so people can look how the effects are done

Its strange that the demos does not run the first time

Mybe it has todo with fileinstall , vista users have the same problem

mybe i have to put some sleep functions between the fileinstalls

i'm glad that it works under windows 2k too

Link to comment
Share on other sites

Hmms

I'm trying to get my "falling snow on desktop" script back to work but it doesn't want to work anymore with the new udf atleast for me it isn't, i could use some advice/help.

I've tryed creating an example script to find out whats wrong but i just can't get it to work.

; include
#include "include\prospeed.au3"

; Options
;#NoTrayIcon
#RequireAdmin
_Singleton(@ScriptName)
Opt("RunErrorsFatal",  0)

; Variables
$Snowflake = @ScriptDir&"\Files\snow.bmp"
$SnowflakeSize = 15
$Sprites = 10
Dim $SpriteList[$Sprites+1], $SpriteLoc=0

; ==================== Snow ====================
WinMinimizeAll()
Sleep(100)
GetDesktopHDC() ; Required for desktop sprites
Sleep(100)

$Snowflake_Load = LoadSprite($Snowflake)
;                       Snowflake        picture x1     Picture y1  Picture x2      Picture y2      Frames  Startframe  Framespeed  X loc   Y loc
$SpriteList[1] = Sprite($Snowflake_Load, 0,             0,          $SnowflakeSize, $SnowflakeSize, 1,      1,          0,          0,      -$SnowflakeSize-1)
SpriteToHDC($SpriteList[1]) ; Move 1st sprite to desktop
SetSpritePos($SpriteList[1], 0, -$SnowflakeSize-1, 0, @DesktopHeight+$SnowflakeSize+1) ; Let the sprite fall down

$i = 2
Do
    $SpriteLoc += $SnowflakeSize+1
    $SpriteList[$i] = CopySprite($SpriteList[1])
    SpriteToHDC($SpriteList[$i]) ; Move sprite to desktop
    
    SetSpritePos($SpriteList[$i], $SpriteLoc, -$SnowflakeSize-1, $SpriteLoc, @DesktopHeight+$SnowflakeSize+1) ; Let the sprite fall down
    $i += 1
Until $i > $Sprites

While 1
    ;
WEnd

Any help would be appreciated.

Thnx Dellairion

Edited by Dellairion
Link to comment
Share on other sites

You have to set the spritebuffer manual

with createbuffer() and setbuffer()

its alot easyer now to chance background for sprites and WM_PAINT

first createbuffer() with your window dimentions like "createbuffer(800,600)"

and then "setbuffer($yourbackgroundpicture)"

you can easy change that to "setbuffer($newbackgroundpicture)"

so all the sprites get this new backgroundbuffer and are painting correctly to the new background

example below;

; include
#include <prospeed.au3>

; Options
;#NoTrayIcon
#RequireAdmin
;~ _Singleton(@ScriptName)
;~ Opt("RunErrorsFatal", 1)

; Variables
$Snowflake = "snow.bmp"
$SnowflakeSize = 27
$Sprites = 10
Dim $SpriteList[$Sprites+1], $SpriteLoc=0

; ==================== Snow ====================
WinMinimizeAll()
Sleep(100)
GetDesktopHDC() ; Required for desktop sprites
Sleep(100)

CreateBuffer(@DesktopWidth,@DesktopHeight)
SetBuffer($hdc)

$Snowflake_Load = LoadSprite($Snowflake)
;                         Snowflake       picture x1     Picture y1  Picture x2    Picture y2    Frames  Startframe  Framespeed  X loc   Y loc
$SpriteList[1] = Sprite($Snowflake_Load, 0,             0,    $SnowflakeSize, $SnowflakeSize, 1,     1,          0,             0,   -$SnowflakeSize-1)
SpriteToHDC($SpriteList[1]) ; Move 1st sprite to desktop
SetSpritePos($SpriteList[1], 0, -$SnowflakeSize-1, 0, @DesktopHeight+$SnowflakeSize+1) ; Let the sprite fall down

$i = 2
Do
    $SpriteLoc += $SnowflakeSize+1
    $SpriteList[$i] = CopySprite($SpriteList[1])
    SpriteToHDC($SpriteList[$i]) ; Move sprite to desktop
    
    SetSpritePos($SpriteList[$i], $SpriteLoc, -$SnowflakeSize-1, $SpriteLoc, @DesktopHeight+$SnowflakeSize+1) ; Let the sprite fall down
    $i += 1
Until $i > $Sprites

While 1
    ;
WEnd
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...