-
VB6 -- Edit Image
Hello,
I wanted help on a program that would edit an image. What i actually want is to add a strip containing some text to the image.
This means that I have to increase the height of the image and add my default banner.
How can this be done ? Is there any available submission or any other post that might help me to get started ??
Thanks for ur Help in advance.
Wiz
-
Re: VB6 -- Edit Image
Check PSC... : planetsourcecode.com ...:wave:
-
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