|
-
Mar 8th, 2010, 12:47 AM
#1
Thread Starter
Lively Member
-
Mar 8th, 2010, 06:12 AM
#2
Re: VB6 -- Edit Image
Check PSC... : planetsourcecode.com ...
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Mar 8th, 2010, 09:37 AM
#3
Re: VB6 -- Edit Image
Here's some code you can study:
Code:
Private Sub Form_Load()
Dim SP As StdPicture
Dim Cap As String 'caption
Dim TH As Long, TW As Long 'text width/height
Dim CapTop As Boolean
CapTop = True
Cap = "Default Caption"
Set SP = LoadPicture("C:\MyDocs\Misc\kws.bmp")
With Picture1
.ScaleMode = vbTwips
.AutoRedraw = True
TW = .TextWidth(Cap)
TH = .TextHeight("|")
.Width = Picture1.ScaleX(SP.Width, vbHimetric, vbTwips)
.Height = Picture1.ScaleY(SP.Height, vbHimetric, vbTwips) + TH
If CapTop Then
.PaintPicture SP, 0, TH
'optional
Picture1.Line (0, 0)-(.Width, TH), vbCyan, BF
.CurrentX = (.Width - TW) \ 2 'center the text
.CurrentY = 0
Else
.PaintPicture SP, 0, 0
Picture1.Line (0, .Height - TH)-(.Width, .Height), vbCyan, BF
.CurrentX = (.Width - TW) \ 2
.CurrentY = .Height - TH
End If
Picture1.Print Cap
End With
End Sub
Tags for this Thread
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
|