Jump to content

Polaroider v1.0.3.1 Update of 03 july 2013


wakillon
 Share

Recommended Posts

Polaroider 1.0.3.1

Easily Create a picture as a Polaroid and be able after, to create Custom Photos Polaroid Collage.

May be you know Pola a soft for create easily Polaroid-like photos from your digital images, but after some tries, i didn't find it very handy !

So i made mine.

 

201306301803461.jpg

Photo can be positioned by drag and zoomed/unzoomed with mouse wheel ( sorry for Touchpad user :P   )

Polaroid can be inclined 10 or 20 degrees, on left or right, and with simple or multiple frames.

Inclination will only be visible on the saved shoot.

It is also saved with a transparent background for be able to create "Pêle-Mêles" (in french) with a photo editor.

I have set the desktop as save directory.

previous downloads : 122

 

source and executable are available in the Download Section

All files are included in script.

I hope you will like it !

Happy Shooting !  ;)

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Nice work wakillon.  :thumbsup:

Just add to line 611

DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $hGraphic6, "int", 4)

to add also antialiasing to Vista+ os.

And here a code to get some information about images:

#include <GDIPlus.au3>

Global $sFile = FileOpenDialog("Select an image", "", "(*.jpg;*.png;*.bmp;*.gif;*.tif;*.ico;*.emf;*.wmf)")
If @error Then Exit
_GDIPlus_Startup()
Global $hImage = _GDIPlus_ImageLoadFromFile($sFile)
Global $aPixelFormat = _GDIPlus_ImageGetPixelFormat($hImage)
Global $aImageRawFormat = _GDIPlus_ImageGetRawFormat($hImage)
Global $hImageContext = _GDIPlus_ImageGetGraphicsContext($hImage)
Global $aImageDPIX = DllCall($ghGDIPDll, "uint", "GdipGetDpiX", "handle", $hImageContext, "float*", 0)
Global $aImageDPIY = DllCall($ghGDIPDll, "uint", "GdipGetDpiY", "handle", $hImageContext, "float*", 0)

MsgBox(0, "Image Information",  "Filename: " & $sFile & @LF & @LF & _
                                "Width: " & @TAB & @TAB & _GDIPlus_ImageGetWidth($hImage) & @LF & _
                                "Height: " & @TAB & @TAB & _GDIPlus_ImageGetHeight($hImage) & @LF & _
                                "DPI: " & @TAB & @TAB & Round($aImageDPIX[2], 0) & "x" & Round($aImageDPIY[2], 0) & @LF & _
                                "Color Depth: " & @TAB & $aPixelFormat[1]  & @LF & _
                                "Image Type: " & @TAB & $aImageRawFormat[1], 30)

_GDIPlus_GraphicsDispose($hImageContext)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()
Exit

When loading large images and moving around the window the window will be jerky. My suggestion scale down the preview image instead to copy always the large image to the preview gfx handle.

Are the tiny loves your kids?

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Link to comment
Share on other sites

Looks good. Thanks for sharing!

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Nice work wakillon.  :thumbsup:

Just add to line 611

DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $hGraphic6, "int", 4)

to add also antialiasing to Vista+ os.

And here a code to get some information about images:

#include <GDIPlus.au3>

Global $sFile = FileOpenDialog("Select an image", "", "(*.jpg;*.png;*.bmp;*.gif;*.tif;*.ico;*.emf;*.wmf)")
If @error Then Exit
_GDIPlus_Startup()
Global $hImage = _GDIPlus_ImageLoadFromFile($sFile)
Global $aPixelFormat = _GDIPlus_ImageGetPixelFormat($hImage)
Global $aImageRawFormat = _GDIPlus_ImageGetRawFormat($hImage)
Global $hImageContext = _GDIPlus_ImageGetGraphicsContext($hImage)
Global $aImageDPIX = DllCall($ghGDIPDll, "uint", "GdipGetDpiX", "handle", $hImageContext, "float*", 0)
Global $aImageDPIY = DllCall($ghGDIPDll, "uint", "GdipGetDpiY", "handle", $hImageContext, "float*", 0)

MsgBox(0, "Image Information",  "Filename: " & $sFile & @LF & @LF & _
                                "Width: " & @TAB & @TAB & _GDIPlus_ImageGetWidth($hImage) & @LF & _
                                "Height: " & @TAB & @TAB & _GDIPlus_ImageGetHeight($hImage) & @LF & _
                                "DPI: " & @TAB & @TAB & Round($aImageDPIX[2], 0) & "x" & Round($aImageDPIY[2], 0) & @LF & _
                                "Color Depth: " & @TAB & $aPixelFormat[1]  & @LF & _
                                "Image Type: " & @TAB & $aImageRawFormat[1], 30)

_GDIPlus_GraphicsDispose($hImageContext)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()
Exit

When loading large images and moving around the window the window will be jerky. My suggestion scale down the preview image instead to copy always the large image to the preview gfx handle.

Are the tiny loves your kids?

Br,

UEZ

 

Hi UEZ 

Is the antialiasing line you suggest need to be repeat for other graphics handles ?

And i don't understand your scale down preview image suggestion...do you want to reduce the preview ? i found it so small !

It interest me because i'm working on another project with bigger photos than this preview.  ;)

And yes, it's my kids (photos are old now)  

Thanks for your help!  :)

 

Very nice thank you very much.  :thumbsup:

 

Glad you like it !

Looks good. Thanks for sharing!

 

Thanks !

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Hi UEZ 

Is the antialiasing line you suggest need to be repeat for other graphics handles ?

And i don't understand your scale down preview image suggestion...do you want to reduce the preview ? i found it so small !

It interest me because i'm working on another project with bigger photos than this preview.  ;)

And yes, it's my kids (photos are old now)  

Thanks for your help!  :)

 

Glad you like it !

 

Thanks !

 

Yes, you can add also to the other gfx handles which makes sense, otherwise only GUI text is anti aliased.

Regarding scale down preview: your polaroid preview has a dimension of 285x285 px and e.g. if you load an image with dimension 2400x3200 px you always copy that image to the preview handle which slows down it extremely. I would scale the image down once only to display it in the preview handle. It will be much faster on repaint activities.

Very cute kids on that picture.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Nice. And lovely kids!

I'm running executable you provided and unfortunately I get crashes on exit, for example if I start the app and then do nothing but close it. I was intrigued so I went through the source you provided and really without goinng too deep saw it's the _ControlGlobalSubclass() that causes the issues.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Yes, you can add also to the other gfx handles which makes sense, otherwise only GUI text is anti aliased.

Regarding scale down preview: your polaroid preview has a dimension of 285x285 px and e.g. if you load an image with dimension 2400x3200 px you always copy that image to the preview handle which slows down it extremely. I would scale the image down once only to display it in the preview handle. It will be much faster on repaint activities.

Very cute kids on that picture.

Br,

UEZ

 

Ok, if after drag'n drop, i do a copy of the photo with a reduced size, it will be less jerky, I'm right ?

But if size is reduced, is quality zoom not affected ?  :huh:

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Nice. And lovely kids!

 

I'm running executable you provided and unfortunately I get crashes on exit, for example if I start the app and then do nothing but close it. I was intrigued so I went through the source you provided and really without goinng too deep saw it's the _ControlGlobalSubclass() that causes the issues.

 

Hi trancexx, glad you like it !  :king:

I can't reproduce your crashes (win7x64)

 

Can you please try this debug way ?

 

1 - add  If @error Then ConsoleWrite ( '@error : ' & @error & @Crlf ) after _ControlGlobalSubclass () line

 

2 - replace _ControlGlobalSubclass () function by this one

 

Func _ControlGlobalSubclass () ; by rover
    If $hNew_ControlProc <> 0 Then Return SetError ( 1, 0, 0 )
    Local $hGUITemp = GUICreate ( '', 1, 1, -10, -10 )
    Local $hButtonTemp = GUICtrlGetHandle ( GUICtrlCreateButton ( '', -10, -10, 1, 1 ) )
    $hNew_ControlProc = DllCallbackRegister ( '_WndProc', 'int', 'hwnd;uint;wparam;lparam' )
    If $hNew_ControlProc = 0 Then Return SetError ( 2, 0, 0 )
    Local $pCallbackPtr = DllCallbackGetPtr ( $hNew_ControlProc )
    If $pCallbackPtr = 0 Then Return SetError ( 3, 0, 0 )
    $pOriginal_ButtonProc = DllCall ( $hUser32DLL, 'dword', 'SetClassLongW', 'hwnd', $hButtonTemp, 'int', -24, 'ptr', $pCallbackPtr ) ; $GCL_WNDPROC
    If @error Then Return SetError ( 4, 0, 0 )
    $pOriginal_ButtonProc = $pOriginal_ButtonProc[0]
    GUIDelete ( $hGUITemp )
    Return SetError ( 0, 0, 1 )
EndFunc ;==> _ControlGlobalSubclass ()

3 - and in _OnAutoItExit () function replace DllCallbackFree ( $hNew_ControlProc ) by :

If $hNew_ControlProc <> 0 Then
        DllCallbackFree ( $hNew_ControlProc )
        If @error Then ConsoleWrite ( '@error : ' & @error & @Crlf )
    EndIf

Thanks for your help  :)

Edit : it's a >Rover's tips for prevent dotted focus lines on controls.

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Take rover's example and remove line

GUIDelete($hGUI)

... then try it. What results you get there?

I see he has this comment which you ignored:

; Must delete subclassed controls before freeing DLLCallbacks 
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

 

Take rover's example and remove line

GUIDelete($hGUI)

... then try it. What results you get there?

I see he has this comment which you ignored:

; Must delete subclassed controls before freeing DLLCallbacks 
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

 

Results return absolutely no crashes, compiled or not, after 10 tries...

+>09:56:04 AutoIt3.exe ended.rc:0
>Exit code: 0    Time: 3.518

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Still, could you add line like that to your app and upload it for me. Polaroider v1.0.2.9.exe crashes for me also.

 

No problem, GUIDelete ( $hGUI ) added in _OnAutoItExit function.

Polaroider v1.0.3.0.exe

i must change file version because with googlecode each uploaded file must have a distinct name.

:)

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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

×
×
  • Create New...