Visual Basic - ayuda URGENTE!!!!!! PLEASE

Life is soft - evento anual de software empresarial
 
Vista:

ayuda URGENTE!!!!!! PLEASE

Publicado por jaime (5 intervenciones) el 01/07/2002 21:44:05
necesito saber como implementar una funcion basada en la api fillpath, que me permita pìntar una cierta figura, O UN AREA CERRADA dandole como parametro la pos x e y, y el color; la posicion x e y estan dentro de la region cerrada que queremos pintar, las figuras ya han sido creadas y lo que se quiere es hacerlo estilo paint donde se pinta una region cerrada.

si alguien sabe por favor envien respuesta al mail. porfa gracias..chao
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:ayuda URGENTE!!!!!! PLEASE

Publicado por Mike (16 intervenciones) el 02/07/2002 21:28:58
Aqui tienes esto, espero que sea lo que buscas.

Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function BeginPath Lib "gdi32" (ByVal hdc As Long) As Long
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
Private Declare Function EndPath Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function StrokePath Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function FillPath Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function StrokeAndFillPath Lib "gdi32" (ByVal hdc As Long) As Long
Private Sub Form_Paint()
Dim hBrush As Long, oldBrush As Long
Const sText = "Hello"
'set the form's font to 'Times New Roman, size 48'
Me.FontName = "Times New Roman"
Me.FontSize = 48
'make sure Me.TextHeight returns a value in Pixels
Me.ScaleMode = vbPixels
'create a new, white brush
hBrush = CreateSolidBrush(vbWhite)
'replace the current brush with the new white brush
oldBrush = SelectObject(Me.hdc, hBrush)
'set the fore color to black
Me.ForeColor = vbBlack
'open a path bracket
BeginPath Me.hdc
'draw the text
TextOut Me.hdc, 0, 0, sText, Len(sText)
%
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar