how do i draw a character on a picturebox at a specified location (x,y) ?
anybody has the codes to do this please help?
Printable View
how do i draw a character on a picturebox at a specified location (x,y) ?
anybody has the codes to do this please help?
Use the TextOut API call:VB Code:
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long TextOut Me.hDC, X-Value, Y-Value, "This is Text!", Len("This is Text!")
Thanks for the code.
but it only works when autoredraw is set to false.
i need to make the text part of the image in the picturebox so i could copy the entire picture into an imagebox.
i used picture1.picture = picture1.image
image1.picture = picture1.picture
can we make the text printed using textout api a permanent part of the picture ?
Use the same code.
Set autoredraw to TRUE
and after you use tha api, do a simple
picture1.refresh
and boom
Or you could use:
Picture1.Print Text$
To specify the location of the text use:
Picture1.CurrentX =
Picture1.CurrentY =
And be sure to set AutoRedraw = True