Jump to content

save a string as a bmp


MerkurAlex
 Share

Recommended Posts

I assume it is possible to save a string as a bmp but i cannot figure it out i was thinking something with gdiplus but i cannot even get the stringdraw example to work it worked ONE time then i tried again and the same code will no longer draw a string can anyone help.

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Link to comment
Share on other sites

I assume it is possible to save a string as a bmp but i cannot figure it out i was thinking something with gdiplus but i cannot even get the stringdraw example to work it worked ONE time then i tried again and the same code will no longer draw a string can anyone help.

Do some forum searching on how to create and save a bitmap with GDI.

Here is my 'Help file' on the DrawString. Does it not work for you?

#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>

Opt('MustDeclareVars', 1)

_Main()

Func _Main()
    Local $hGUI, $hWnd, $hGraphic

    ; Create GUI
    $hGUI = GUICreate("GDI+", 400, 300)
    $hWnd = WinGetHandle("GDI+")
    GUISetState()

    ; Draw a string
    _GDIPlus_Startup ()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
    _GDIPlus_GraphicsDrawString ($hGraphic, "Hello world", 140, 110)

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Clean up resources
    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_Shutdown ()

EndFunc   ;==>_Main
Link to comment
Share on other sites

  • Moderators

If you're trying to do this on the fly... something like:

CreateCompatibleDC

CreateBitmap

TextOut or DrawText

Would probably work.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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