using textout api function
|
Light Poster
|
|
| 22Sep2010,21:34 | #1 |
|
did anyone know how set fontsize with textout api thanks
|
|
Pro contributor
|
![]() |
| 23Sep2010,02:33 | #2 |
|
Quote:
http://www.ex-designz.net/apidetail.asp?api_id=343
drnda
likes this
|
|
Light Poster
|
|
| 27Sep2010,13:57 | #3 |
|
yes i know that but it can`t aply with picturebox, and I need dinamicly set horizontal text means like this
dim text as string text="something" dim txt as integer,vt as integer txt=len(text) hz=picture1.hwight-txt textout hz,vt,text,txt sorry for my bad english thanks
|
|
Pro contributor
|
![]() |
| 28Sep2010,02:00 | #4 |
|
picturebox has font property.Did you try setting it's font size before using
textout? Code:
.......... Private Sub Command1_Click() Dim retval As Long ' return value retval = SetTextAlign(mem_dc, TA_CENTER Or TA_TOP Or TA_NOUPDATECP) Picture1.FontSize = 50 retval = TextOut(Picture1.hdc, 100, 50, "Hello, world!", 13) End Sub ........ Last edited by virxen; 28Sep2010 at 02:24..
drnda
likes this
|
|
Light Poster
|
|
| 28Sep2010,13:52 | #5 |
|
Yes, I tried that, but doesn`t work. Did You have any other sugestion?
I `ll send you small code of my work. please tell me if I do some wrong. thank`s Code:
Private Sub Slider1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer2.Enabled = False
End Sub
Private Sub Slider1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer2.Enabled = True
poz.CurrentPosition = Slider1.Value
starts = Slider1.Value
find_start (starts) 'search for time
DoEvents
End Sub
Private Sub Timer1_Timer()
' searching for same time at the listview
' and when found then set text on picturebox (Ekran)
On Error Resume Next
Dim dc As Long
Dim cr As Long
Dim SubTitl As String
Dim start As String
Dim sstop As String
Dim p As Integer, p1 As Integer, scn As Long
Dim hz As Integer, vrt As Integer, lst As Integer
hz = 0: vrt = 0: lst = 0
Label3.Caption = TimSet(poz.Duration)
Label2.Caption = TimSet(poz.CurrentPosition)
starts = poz.CurrentPosition
find_start (starts) ' when slider is moving search the time
sstop = Left$(ListView1.ListItems.Item(stnum).SubItems(2), 8) ' stop time
start = Left$(ListView1.ListItems.Item(stnum).SubItems(1), 8) ' start time
If TimSet(poz.CurrentPosition) = start Then
SubTitl = ListView1.ListItems.Item(stnum).SubItems(3) ' set text to subtitle string
lst = (Len(SubTitl) \ 2)
hz = (Ekran.Height \ 2) - lst
vrt = 250
dc = TxtInsert.GetHDC()
cr = TxtInsert.ColourKey
SetBkColor dc, cr
cr = 16777215 'bijela boja, white colour
SetTextColor dc, cr
Ekran.FontSize = 50
TextOutA dc, hz, vrt, SubTitl, Len(SubTitl)
TxtInsert.ReleaseDC dc
ElseIf TimSet(poz.CurrentPosition) = sstop Then
stnum = stnum + 1 ' set to next search stnum is up[/COLOR]
End If
End Sub
Private Sub Timer2_Timer()
Slider1.Value = poz.CurrentPosition
End Sub
Private Function TimSet(SecAply As Double) As String
On Error Resume Next
Dim Sek, Mnt, Sat
SecAply = Int(SecAply)
If SecAply < 1 Then TimSet = "00:00:00": Exit Function
Sek = SecAply - Int(SecAply / 60) * 60
Mnt = Int((SecAply - Int(SecAply / 3600) * 3600) / 60)
Sat = Int(SecAply / 3600)
If Int(Sat) > 24 Then
TimSet = "24:59:59"
Else
TimSet = Format(str(Sat) & ":" & str(Mnt) & ":" & str(Sek), "hh:mm:ss")
End If
End Function
Private Function find_start(st As Double) As String
Dim i As Integer
Dim stext As String, ftext As String
ftext = TimSet(st)
For i = 1 To ListView1.ListItems.Count
stext = Left$(ListView1.ListItems.Item(i).SubItems(1), 8)
If ftext = stext Then
stnum = i
Exit For
End If
Next i
stext = ""
ftext = ""
End Function
|
|
Pro contributor
|
![]() |
| 29Sep2010,03:56 | #6 |
|
Quote:
Code:
............. Ekran.FontSize = 50 TextOut(Ekran.hdc, hz, vrt, SubTitl, Len(SubTitl) .............
drnda
likes this
|
|
Light Poster
|
|
| 29Sep2010,22:57 | #7 |
|
I forgot to tell you, I using OVTOOLLibrary.
Maybe is problem with this lib. |

