|
-
Feb 18th, 2002, 12:12 PM
#1
Thread Starter
Lively Member
drawing characters on picuturebox
how do i draw a character on a picturebox at a specified location (x,y) ?
anybody has the codes to do this please help?
-
Feb 18th, 2002, 03:53 PM
#2
Good Ol' Platypus
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!")
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Feb 18th, 2002, 05:57 PM
#3
Thread Starter
Lively Member
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 ?
-
Feb 18th, 2002, 07:21 PM
#4
Hyperactive Member
Use the same code.
Set autoredraw to TRUE
and after you use tha api, do a simple
picture1.refresh
and boom
-
Feb 18th, 2002, 07:26 PM
#5
Fanatic Member
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
Last edited by McCain; Feb 18th, 2002 at 08:12 PM.
Never argue with fools, they will only drag you down to their level, and beat you with experience.
Q: How do you tell an experienced hacker from a novice?
A: The latter thinks there's 1000 bytes in a kilobyte, while the former is sure there's 1024 meters in a kilometer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|