Jump to content



Photo

ShiftER


  • Please log in to reply
19 replies to this topic

#1 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 14 December 2009 - 11:46 PM

Last version at post #20

I couldn't find any good software for viewing pictures on UMPC and MID devices so I created my own.

Graphics are handled with SDL.

You'll need to get the following files from my SDL UDF:
SDL.au3 & SDL.dll
SDL_image.au3
SDL_gfx.au3 & SDL_gfx.dll

For full capabilities you also need:
SDL_image.dll & jpeg.dll & libpng12-0.dll & zlib1.dll

Spoiler


Last version at post #20

Edited by AdmiralAlkex, 05 May 2010 - 04:15 AM.








#2 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,194 posts

Posted 15 December 2009 - 11:21 AM

What a cool invisible controls! I like that very much. Once you figure them out all works great (except some pics are rotated).

I only have one remark. It's editors gui. I like it this way much more (just PC):
$hWnd = GUICreate(@ScriptName & " Playlist editor", 500, 400, -1, -1, -1, 0x00000008) ; $WS_EX_TOPMOST


Refreshing.

Edited by trancexx, 15 December 2009 - 01:43 PM.

eMyvnE


#3 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 04 February 2010 - 10:28 PM

What a cool invisible controls! I like that very much. Once you figure them out all works great (except some pics are rotated).

Sorry to be this late, but thank you for your appreciation. You think you could give this a quick spinn too? What do you think of the third question? :D

@all
ShiftER v7

So now when I have everyones attention, what's new in v7? Very little. What changed then? Very much.
I decided to get rid of everything that doesn't fit a UMPC, and to simplify things a great deal.

Battery-bar should be fixed (if it was ever broken).
Slideshow workings changed.
Animation is gone.
(Optional) rotation is gone.
Caching is gone.
Most options are gone.
UI is redone.
Playlist editor is gone.
SDL_Sprig no longer used.
jpeg.dll, libpng12-0.dll and zlib1.dll is optional.

Every line of code was meticulously studied, resulting in many changes in the code.

This will have to do as a tutorial this time:
Posted Image
(ninjastar = ninjapad).

I estimate there will be at least 1 more release before I show this on UMPC targeted forums. The UI needs to be more user friendly, while at the same time providing more controls. Rotation will come back.

Attached File  ShiftER v7.au3   10K   249 downloads

I'm hungry.

#4 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,194 posts

Posted 06 February 2010 - 01:05 AM

Sorry to be this late, but thank you for your appreciation. You think you could give this a quick spinn too?

Sure.

What do you think of the third question? :D

It's not bad. Have seen better though.
Btw, I hate inis.

I'm hungry.

Go eat something. :huggles:

It's crashing on large BMPs (few MB).

eMyvnE


#5 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 07 February 2010 - 10:57 PM

Sure.

Thanks.

Btw, I hate inis.

Do you have any suggestion for something less "hateable"? I like to have portability so the registry is not very interesting, and XML files are to advanced to save a handful of options.

Go eat something. :huggles:

It's crashing on large BMPs (few MB).

Yeah I kinda figured that out myself after a while :D

Does it always happen on the same picture? Would you mind sending me it so I could have a look?

#6 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,194 posts

Posted 08 February 2010 - 12:51 AM

Does it always happen on the same picture? Would you mind sending me it so I could have a look?

It's function _SDL_rotozoomSurface().
Here's PNG, for example, that's crashing for me (dimension related).
untitled.PNG

eMyvnE


#7 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 08 February 2010 - 01:00 AM

It's function _SDL_rotozoomSurface().
Here's PNG, for example, that's crashing for me (dimension related).

Ummm that was kinda strange. I also had the same problem, but I just fixed that like an hour ago.... Or so I thought. There's something in that pic that makes it worse than the ones I had...

Why do you think it's the dimensions?

#8 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 08 February 2010 - 01:16 AM

This is it, I think I got it. Earlier to night I saw that converting surfaces to 32 bit seemed to fix a lot of crashes. Now I made sure that the size was an even number, and I could display your PNG. I'm not sure this is the best way to fix it, but anyway;
Func _SuperLoad()     $pLoad = _IMG_Load($aPlayList[$iCurrent])     $hStruct = DllStructCreate($tagSDL_SURFACE, $pLoad)     $W = DllStructGetData($hStruct, "w")     $Y = DllStructGetData($hStruct, "h")     If IsInt($W/2) <> True Then $W -= 1     If IsInt($Y/2) <> True Then $Y -= 1     $pFix = _SDL_CreateRGBSurface($_SDL_SWSURFACE, $W, $Y, 32, $iNull, $iNull, $iNull, $iNull)     _SDL_BlitSurface($pLoad, 0, $pFix, 0)     _SDL_FreeSurface($pLoad)     Return $pFix EndFunc

That works alot better for me.

Edit: Meh, still got crashes with other files, forget what I just wrote.

Edited by AdmiralAlkex, 08 February 2010 - 01:20 AM.


#9 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,194 posts

Posted 08 February 2010 - 01:23 AM

That pic is 508x1025.
If the sum of width and height is over 522729 (more-less) and _SDL_rotozoomSurface() is used it would crash.

eMyvnE


#10 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 08 February 2010 - 01:27 AM

I don't think it's that simple. I have a 15000x7500 bmp and png that works without a problem. I also have a jpg that fails and it's only 376x490.
I'm starting to think that SDL_gfx is broken. Shame I can't fix it... And doing the rotation in AutoIt would be to slow.

#11 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,194 posts

Posted 08 February 2010 - 01:29 AM

I don't think it's that simple. I have a 15000x7500 bmp and png that works without a problem. I also have a jpg that fails and it's only 376x490.
I'm starting to think that SDL_gfx is broken. Shame I can't fix it... And doing the rotation in AutoIt would be to slow.

15000x7500 wouldn't use _SDL_rotozoomSurface(). Or it would?

eMyvnE


#12 monoceres

monoceres

    asdf

  • MVPs
  • 3,720 posts

Posted 08 February 2010 - 01:52 AM

Without even reviewing the source, it hasn't got anything to do with some very classic rotating memory problems?
http://andhen.mine.nu/av.png
Posted ImageIs the link in my post broken? I do not longer own my domain, all the files are moved to my new domain.Example: http://monoceres.se/test.au3 -> http://andhen.mine.nu/monoceres.se/test.au3

#13 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 08 February 2010 - 02:00 AM

15000x7500 wouldn't use _SDL_rotozoomSurface(). Or it would?

Errm no it wouldn't, it would use _SDL_zoomSurface :huggles:
I rotated that picture and it doesn't work anymore :D

Without even reviewing the source, it hasn't got anything to do with some very classic rotating memory problems?
http://andhen.mine.nu/av.png

I'm not sure how to answer that without knowing C/C++. When the pic is rotated, it's written to a surface that SD_gfx.dll creates itself. And the pic is only rotated 270 degrees, that shouldn't be very hard to calculate...

#14 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 08 February 2010 - 02:38 AM

Well it works now (I promise!). They key was to give up... Well sort of. It works if you split it into two steps, as in:
$pTemp = _SDL_rotozoomSurface($pSrc, 270, 1, 0);Rotate $pDst = _SDL_zoomSurface($pTemp, $DZ, $DZ, 1);Zoom and Smooth _SDL_FreeSurface($pTemp);Waste disposal

It's more work, but I don't see that I have any other choice.

#15 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,194 posts

Posted 08 February 2010 - 09:03 AM

Yes, that's working.
Nice pic monoceres.

eMyvnE


#16 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 14 February 2010 - 09:19 PM

Shifter v8

I decided to move away from the invisible controls, as they are too hard to use, I keep pressing on the wrong place all the time :mellow:
I guess we could call this release a "sanity check", as I need to make sure I'm not crazy for doing this move.

The invisible controls are still there as in v7, except the slideshow-button shrunk downwards, and now covers the third quarter on the Y-axis.
The upper 20% of the window is what is really interesting, (left) click and drag down to open the new icon-driven interface. There you can change settings for zoom, rotation, animation, and randomization of playback. Press somewhere on the outside to go back to the normal view. The settings are not (yet) saved.

For the future I was thinking I should move all the invis. controls to icons, except exit and ninja-bar. You could then have simple mouse gestures like a sweep to the right to go to next image, while still having everything else another sweep away.


Attached File  ShiftER v8.zip   50.29K   196 downloads


Am I crazy?

Edited by AdmiralAlkex, 14 February 2010 - 09:28 PM.


#17 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,194 posts

Posted 15 February 2010 - 08:36 AM

You have Star Trek duck standing on something that appears to be two balls as avatar. Of course you are crazy.

click/dragdown sometimes even works for me. :mellow:

eMyvnE


#18 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 14 March 2010 - 04:26 AM

I have a question for YOU! Yes, I'm pointing at YOU, the reader!

What would YOU like to happen when ShiftER is started without any command line parameter(s)?
You know, without dragging anything to it.

Come on now people, I want lots of ideas, good or bad, crazy or smart, it doesn't matter, just give me ANYTHING.


And the winner will get.... Nothing! :mellow:

Edited by AdmiralAlkex, 14 March 2010 - 04:26 AM.


#19 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 09 April 2010 - 04:06 AM

Today is a good day to die.

Shifter v16

Added:
*Playlist saved at exit.
*Continue old playlist if no command line parameters provided.
*Some settings.
*Settings are now saved at exit.
*Some Basic error resilience + colorful error screen.
*Should now work without SDL_Image (not really tested), but then you'll only be able to load bmp files.
*Some progress bars.

Fixed/Changed:
*Randomizing improved.
*More touch-screen friendly (sort of, not satisfied with that yet).
*Battery-thingy fixed (again!).
*Lots of transition-related fixes.
*When you press an "Icon" the dialog will not exit automatically (makes it much faster to change multiple settings).

Removed:
*Animation 3 sucked.


Instructions:
Next image: Drag left, mouse-button 5 or wheel down.
Previous image: Drag right, mouse-button 4 or wheel up.
"Icon-Interface": Drag down.
Exit: Drag up.

The Ninja-bar can be found in the bottom right (by default 10 pixels wide and high).


Notes:
The art for the "Icon-Interface" sucks. Maybe I'll just redo all of them.


Download:
Attached File  ShiftER v16.zip   12.42K   140 downloads
(you'll have to take the rest of the graphics from the previous zip, or maybe just try without them :()

Edited by AdmiralAlkex, 09 April 2010 - 04:14 AM.


#20 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 04 May 2010 - 08:22 PM

That was a long day.

Shifter v28

Some text:
There was a lot of general cleanup done here. The 4 slowest operations used to be:
  • Loading and Saving to playlist-file
  • Loading from command line
  • Randomizing playlist-array
These are all now virtually instant. A faster PC needs around 100k items before noticeable slowdowns occur.

Added:
Some experiments with Static.
Another progressbar implemented, set ProgressWay=2 to see.
Smarter writing to Settings.ini at exit (useful for SSD and such I imagine) if SmartWrite=1.
Slideshow mechanism is finally back.
Animations for the Icon-Interface. They're on a Adlib so you can continue clicking without interruption.

Fixed/Changed:
Vastly improved the progressbars behaviors.
New format for playlist-file. Faster and handles practically infinite amount of items.
Less global variables due to restructured beginning and main-loop code.

Removed:
Mouse-Gestures.


Instructions:
Next image: Press lower half of screen, mouse-button 5 or wheel down.
Previous image: Press upper half of screen, mouse-button 4 or wheel up.
Icon-Interface: Right-click.
Exit: On the Icon-Interface.

The Ninja-bar can be found in the bottom right (by default 10 pixels wide and high).


Notes:
The art for the Icon-Interface was redone.


Download:
Attached File  ShiftER v28.zip   24.2K   237 downloads


So what do you think?

Edited by AdmiralAlkex, 04 May 2010 - 08:53 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users