Jump to content

Images caption with gradient header - Possible?


Mun
 Share

Recommended Posts

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
Link to comment
Share on other sites

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

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

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...