 |
| View previous topic :: View next topic |
| Author |
Message |
boroarke Newbie
Joined: 27 Apr 2006 Posts: 1
|
Posted: Apr 27th, 2006 11:24 AM Post subject: Add text to image in picturebox |
|
|
I'm still pretty new to programming so please bare with me and any help that can be offered is greatly appreciated. I have a program in which the user loads an image which is displayed in a picturebox. The user can then print this image from their printer. I would like to add controls which will allow the user to click anywhere in the picture box and then type text which will be printed on the image when the image is later printed. I would like the user to be able to select the font from a list of fonts already installed on the users PC as well as the size of the font and the color. Once the text is typed, id like the user to have the ability to click the text and be able to move it, edit it or delete it.
Is this something that would be fairly simple to do? Any one know of a tutorial or guide that will walk me through the process of doing something like this? Thanks in advance for any help!
Bryan |
|
| Back to top |
|
sprog90 Newbie

Joined: 21 Jul 2005 Posts: 20
|
Posted: May 1st, 2006 03:55 AM Post subject: |
|
|
For the list with the fonts use that code
| Code: | Private Sub Form_Load()
For i = 1 To Screen.FontCount - 1
List1.AddItem Screen.Fonts(i)
Next
End Sub |
or
| Code: | CommonDialog1.Flags = cdlCFBoth
CommonDialog1.ShowFont |
The other changes like colour, size, you can change them using
| Code: | Label1.ForeColor = &HFF&
Label1.FontSize = 12
Label1.FontName = List1.Text |
Now about the text you can use a label with the property backstyle = 0-transparent
To edit it you can use:
| Code: | | Label1.Caption = InputBox("Change the label's caption") |
To delete it you can use:
| Code: | | Label1.Visible = False |
To move it you can use 4 buttons and then the code:
| Code: | Private Sub cmdDown_Click()
Label1.Top = Label1.Top + 50
End Sub
Private Sub cmdLeft_Click()
Label1.Left = Label1.Left - 50
End Sub
Private Sub cmdRight_Click()
Label1.Left = Label1.Left + 50
End Sub
Private Sub cmdUp_Click()
Label1.Top = Label1.Top - 50
End Sub |
Now about the printing you can use the me.PrintForm, that print all the form, but i think that is not actually what you need. |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|