Sign in to follow this  
Followers 0
Mun

Images caption with gradient header - Possible?

4 posts in this topic

Can autoit capable of attaching a header (create on the fly or attach another .jpg header) to an image and output result like this?

post-76668-0-51235200-1356152729_thumb.j

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I'd do it with AutoIt and SDL.

GDI is good too, but I don't know GDI.

There is probably a better solution.

You could load a surface variable with bmp file data, maybe jpg will work for you, I use bmp to do the editing then make a jpg out of the final image.

Then load your header into a surface, draw the header on the first surface, then save the first surface to bmp.

You could draw your header surface with alpha gradient lines with a function or editor.

Edited by Xandy

I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yes, it is possible with GDI+.

You can use this function to create it:

Func _GDIPlus_LineBrushCreate($nX1, $nY1, $nX2, $nY2, $iARGBClr1, $iARGBClr2, $iWrapMode = 0)
    Local $tPointF1, $pPointF1
    Local $tPointF2, $pPointF2
    Local $aResult
    $tPointF1 = DllStructCreate("float;float")
    $pPointF1 = DllStructGetPtr($tPointF1)
    $tPointF2 = DllStructCreate("float;float")
    $pPointF2 = DllStructGetPtr($tPointF2)
    DllStructSetData($tPointF1, 1, $nX1)
    DllStructSetData($tPointF1, 2, $nY1)
    DllStructSetData($tPointF2, 1, $nX2)
    DllStructSetData($tPointF2, 2, $nY2)
    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", $iARGBClr1, "uint", $iARGBClr2, "int", $iWrapMode, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aResult[6]
EndFunc   ;==>_GDIPlus_LineBrushCreate

This function returns a brush handle which can be used with _GDIPlus_GraphicsFillRect() function to create the header you want.

Br,

UEZ

Edited by UEZ
2 people like this

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

UEZ Thank you for pointing me to the right direction.

It's work perfectly.

Share this post


Link to post
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
Sign in to follow this  
Followers 0