• Martes 16 de Abril de 2024, 15:51

Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Temas - Begeo

Páginas: [1]
1
VB .NET / Formularios y GDI+
« en: Miércoles 7 de Enero de 2009, 01:12 »
Busca en google... Busca en google...Busca en google...Busca en google...Busca en google... Busca en google... Busca en google... Busca en google...Busca en google...

Saludos. Termine esta tarde una buena parte de mi programa, y pensaba que era un buen momento para meter un huevo de pascua (...). Lo que intento hacer es que se sobreponga una imagen desde un archivo (.png ) con transparencia propia para que se pueda ver la imagen que hay debajo (un control). Llevo ya 3 horas intentandolo.

Estaba siguiendo http://www.codeproject.com/KB/GDI-plus/ ... nding.aspx para hacerlo, pero esta en C# (cosa que no tendria que ser un problema). El problema en si reside en que me pierdo con la matriz. O sea, llego a lo de "As New ColorMatrix(crlMatrix)", pero me dice que crlMatrix no existe.

Código: vb.net
  1. Imports System.Drawing.Drawing2D
  2. Imports System.Drawing
  3. Imports System.Drawing.Imaging
  4. Imports System.Drawing.Imaging.ColorMatrix
  5. Public Class ColorMatrix
  6.     Dim AlphaMatrix As Single(,) = { _
  7. {1, 0, 0, 0, 0}, _
  8. {0, 1, 0, 0, 0}, _
  9. {0, 0, 1, 0, 0}, _
  10. {0, 0, 0, 1, 0}, _
  11. {0, 0, 0, 0, 1}}
  12. End Class
  13.  
  14. Public Class Battle
  15. ',,, aqui va el sub Batte_Load. He ignorado el material sin importancia.
  16. 'Loading Easter Eggs
  17.         Dim LeftOver1 As Image = Image.FromFile(Application.StartupPath + "gfxleftover1.png")
  18.  
  19.  
  20.         LogTXT.Text = "System>Graphics loaded." + vbNewLine + LogTXT.Text
  21.         Dim AlphaMtx As New ColorMatrix(AlphaMatrix)
  22.         Dim AlphaAtt As ImageAttributes
  23. '...material sin importancia ignorado!
  24.  

Una ayudita por favor?  :(

2
Sobre los Foros de SoloCodigo / Kickeadme del chat, por favor.
« en: Sábado 3 de Enero de 2009, 22:03 »
Saludos.

Iba a entrar al chat, y pulse en el enlace, pero le di demasiado pronto a recargar, y ahora no me deja entrar 'porque ya estoy dentro'. Les importa kickearme de la sala? Gracias. ^_^

3
Redes y Comunicaciones / Indiana jhones en busca del paquete perdido
« en: Lunes 25 de Agosto de 2008, 12:13 »
Saludos.

He intentado agregarle funcionalidad multijugador a mi programita, y estoy teniendo varios problemas en lo que respecta al que hace de servidor, esperar a que llegue un paquete, y cargar datos de un ini.

Básicamente, el servidor no está reciviendo ningún dato del cliente, pero tampoco esperando a que lo reciba (o eso me parece). He intentado hacer varios fixes pero no he podido al final. Igual ustedes me pueden ayudar a encontrar el error.

Código: Text
  1. Private Sub Connect_Click()
  2. If ActAs = "Serve" Then Exit Sub
  3.  
  4. Winsock1.RemoteHost = txtIP.Text
  5. Winsock1.RemotePort = txtPORT.Text
  6.  
  7. Winsock1.Close
  8. Winsock1.Connect
  9.  
  10. ActAs = "Client"
  11.  
  12. txtIP.Text = "Found match!"
  13. End Sub
  14.  
  15. Private Sub CServ_Click()
  16. If ActAs = "Client" Then Exit Sub
  17.  
  18. Winsock1.Close
  19.  
  20. ActAs = "Serve"
  21.  
  22. Winsock1.LocalPort = txtPORT.Text
  23.  
  24. Winsock1.Listen
  25.  
  26. txtIP.Text = "Waiting for a rival . . ."
  27. End Sub
  28.  
  29. Private Sub Dissc_Click()
  30. Winsock1.Close
  31. End
  32. End Sub
  33.  
  34. Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
  35.  
  36. Winsock1.Close
  37.  
  38. ShallNotPass = True
  39.  
  40. Winsock1.Accept requestID
  41.  
  42. TTGameOnline.CHATwin.SelStart = Len(TTGameOnline.CHATwin.Text)
  43. TTGameOnline.CHATwin.Text = TTGameOnline.CHATwin.Text & TTGameOnline.GetVar(App.Path & "player.ini", "PLAYER", "Name") & " Is acting as SERVER!" & vbCrLf
  44. TTGameOnline.CHATwin.SelStart = Len(TTGameOnline.CHATwin.Text)
  45.  
  46. Winsock1.SendData "1" & TTGameOnline.GetVar(App.Path & "player.ini", "PLAYER", "Name") & " Is acting as SERVER!" & vbCrLf
  47.  
  48. 'Cartejas1 = GetVar(App.Path & "player.ini", "PLAYER", "Card1")
  49. 'Cartejas2 = GetVar(App.Path & "player.ini", "PLAYER", "Card2")
  50. 'Cartejas3 = GetVar(App.Path & "player.ini", "PLAYER", "Card3")
  51. 'Cartejas4 = GetVar(App.Path & "player.ini", "PLAYER", "Card4")
  52. 'Cartejas5 = GetVar(App.Path & "player.ini", "PLAYER", "Card5")
  53. Debug.Print Cartejas1
  54. Winsock1.SendData "_"
  55.  
  56. txtIP.Text = "Found match!"
  57.  
  58. End Sub
  59.  
  60. Public Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
  61.  
  62. Winsock1.Close
  63.  
  64. MsgBox "Lost connection with game partner. Error:" & Number
  65.  
  66. TTGameOnline.Hide
  67. MultiplayForm.Show
  68. End Sub
  69.  
  70. Public Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
  71. Dim Buffer As String
  72.  
  73. Winsock1.GetData Buffer
  74.  
  75. If Left(Buffer, 1) = "1" Then
  76.     Buffer = Mid(Buffer, 2, Len(Buffer))
  77.     TTGameOnline.CHATwin.Text = TTGameOnline.CHATwin & Buffer & vbCrLf
  78. End If
  79. If Left(Buffer, 1) = "z" Then
  80.     MsgBox "The game partner has left the session."
  81.     MultiplayForm.Winsock1.Close
  82.     Me.Show
  83.     TTGameOnline.Hide
  84. End If
  85. Cartejas1 = GetVar(App.Path & "player.ini", "PLAYER", "Card1")
  86. Cartejas2 = GetVar(App.Path & "player.ini", "PLAYER", "Card2")
  87. Cartejas3 = GetVar(App.Path & "player.ini", "PLAYER", "Card3")
  88. Cartejas4 = GetVar(App.Path & "player.ini", "PLAYER", "Card4")
  89. Cartejas5 = GetVar(App.Path & "player.ini", "PLAYER", "Card5")
  90. If Left(Buffer, 1) = "C" Then
  91. '    If ShouldClientNotPass = True Then Exit Sub
  92. '    If Left(Buffer, 2) = "Y" Then ShallNotPass = False
  93. '    If ShallNotPass = True Then Exit Sub
  94.  
  95.     If ActAs = "Serve" Then
  96. '        ShouldClientNotPass = True
  97.         Winsock1.SendData "CN" & Cartejas1 & Cartejas2 & Cartejas3 & Cartejas4 & Cartejas5
  98.     End If
  99.     'For i = 1 To 5
  100.     '    EneDCards(i) = CInt(Left(Buffer, i + 1))
  101.     'Next i
  102. '    Dim i As Integer
  103. '    Dim doomstring(1 To 5) As String
  104. '    For i = 1 To 5
  105. '        doomstring(i) = Left(Buffer, 2 + i)
  106. '        Debug.Print doomstring(i); v
  107. '    Next i
  108.    
  109.     EneCar = Left(Buffer, 3)
  110.     Call PutVar(App.Path & "player.ini", "PLAYER2", "Card1", EneCar)
  111.     EneCar = Left(Buffer, 4)
  112.     Call PutVar(App.Path & "player.ini", "PLAYER2", "Card2", EneCar)
  113.     EneCar = Left(Buffer, 5)
  114.     Call PutVar(App.Path & "player.ini", "PLAYER2", "Card3", EneCar)
  115.     EneCar = Left(Buffer, 6)
  116.     Call PutVar(App.Path & "player.ini", "PLAYER2", "Card4", EneCar)
  117.     EneCar = Left(Buffer, 7)
  118.     Call PutVar(App.Path & "player.ini", "PLAYER2", "Card5", EneCar)
  119.     TTGameOnline.Show
  120.     Me.Hide
  121.    
  122. End If
  123. If Left(Buffer, 1) = "_" Then
  124.     Winsock1.SendData "CY" & Cartejas1 & Catejas2 & Catejas3 & Catejas4 & Catejas5
  125. End If
  126. End Sub
  127.  

También les dejo el código completo por si quieren echarle un vistazo más de cerca:
*cought mejor no, privilegios cought*

Espero su respuesta.

4
Visual Basic para principiantes / Encuentra el error
« en: Jueves 21 de Agosto de 2008, 16:50 »
Saludos.

Verán, me di cuenta de que de los errores se aprenden. Así, solemos encontrar nuestros errores a tiempo, mientras que otros más o menos graves son dejados de la mano de dios.

La idea de este tópic es, para los que no les importe postear un poco de su código, mostrar pequeños trozos de código mostrando errores que hemos encontrado, para que no sólo nosotros aprendamos, sino también los demás.

Empiezo yo con este trozo:

Código: Text
  1. Dim CartaElegida As Integer
  2. Dim VolverAEmpezar As Boolean
  3. VolverAEmpezar = True
  4. Do While VolverAEmpezar = True
  5.     CartaElegida = CStr(Rand(1, 5))
  6.  

Encuentren los errores ;3

5
Visual Basic 6.0 e inferiores / Api, .ini, y rutas de archivo.
« en: Lunes 18 de Agosto de 2008, 12:59 »
Saludos.

Me dirijo a ustedes para intentar solventar ese problema con mi pequeño proyecto.

Código: Text
  1. Dim TemCard As Integer
  2. Dim TemCarNumber As Integer
  3. Dim TemCarRoute As String
  4. Dim TemCarNumberStr As String
  5. TemCard = Val(GetVar(App.Path & "cards.ini", "AMMOUNT", "CardAmmount"))
  6. TemCarNumber = Rand(1, TemCard)
  7. TemCarNumberStr = "C" & CStr(TemCarNumber)
  8. TemCarRoute = GetVar(App.Path & "cards.ini", TemCarNumberStr, "NameB")
  9. B1.Picture = LoadPicture(App.Path & "GFX" & TemCarRoute)
  10.  
No encuentro el problema aquí, ya que teóricamente, la salida de "B1.Picture = LoadPicture(App.Path & "GFX" & TemCarRoute)" tendría que ser App.PathGFXBA215.jpg (BA215.jpg es el valor de NameB en cards.ini).

Pero, en la práctica, la línea "TemCarRoute = GetVar(App.Path & "cards.ini", TemCarNumberStr, "NameB")" no devuelve ningún valor.

Ayuden, si no les importa.  ^_^

Más cosas que podrían ser útiles:

cards.ini
Código: Text
  1. [AMMOUNT]
  2. CardAmmount=1
  3. [C1]
  4. NameB=BA215.jpg
  5. NameR=RA215.jpg
  6. Up=10
  7. Left=2
  8. Right=1
  9. Down=5
  10.  

Función para leer .ini
Código: Text
  1. Public Function GetVar(File As String, Header As String, Var As String) As String
  2. Dim sSpaces As String   ' Max string length
  3. Dim szReturn As String  ' Return default value if not found
  4.  
  5.     szReturn = vbNullString
  6.  
  7.     sSpaces = Space$(1000)
  8.  
  9.     Call GetPrivateProfileString(Header, Var, szReturn, sSpaces, Len(sSpaces), File)
  10.  
  11.     GetVar = RTrim$(sSpaces)
  12.     GetVar = Left(GetVar, Len(GetVar) - 1)
  13. End Function
  14.  

6
C/C++ / Formatear/dar Nuevo Valor A Un Char
« en: Sábado 2 de Febrero de 2008, 13:37 »
Soy una inútil, lo sé.


Bueno, pues me dió por ahi a hacer un programa de práctica. Llevo ya 189 y bla bla bla bla.

Me encuentro con el problema de que tengo que formatear/reasignar un valor a una cadena CHAR. (Sé que no soy la mejor usando vocabulario técnico...)

Me dijeron que tenía que poner variable[numeroarray] = {valor} , pero no me sirvió.

Uso linux.

No quiero usar string.h porque, aparte de que es una libreria bastante gorda, no me carga.

¿Ayuda?

7
C/C++ / Programación De Kernel
« en: Domingo 20 de Enero de 2008, 19:21 »
Hola.

Empecé a mirarme guías de programación de kernel para linux, y encontré una bastante buena. Llegué al punto 2.2, e hice el "hello world" tal y como dijo el tutorial:

Código: Text
  1. /* My first kernel module
  2. OMFG */
  3. #include <linux/module.h> /*It's required for modulessssssss!*/
  4. #include <linux/kernel.h> /*It's required to give the errooooooor */
  5.  
  6. int init_module(void)
  7. {
  8.    printk("<1>Hello world 1.\n");
  9.  
  10.    // Let's see, this tutorial says that not returning 0, means the module cant be loaded. Great.
  11.    return 0;
  12. }
  13.  
  14. void cleanup_module(void)
  15. {
  16.    printk(KERN_ALERT "OMFG THE WORLD GONE TO SHIT!.\n");
  17. }
  18.  
El problema está en los #include, exactamente #include <linux/module.h>, que no me lo reconoce el compilador de gcc.

Leí por ahí que tenia que tener mi propia versión del kernel compilado, pero no tengo ni idea de cómo hacerlo (Help plox?).¿Me pueden decir cómo puedo solucionar mi problema?
Citar
gcc '/home/begeo/デスクトップ/kernelmod.c' -W -Wall -Wstrict-prototypes -Wmissing-prototypes -isystem /lib/modules'uname -r'/build/include -02 -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE}
gcc: unrecognized option '-02'
/home/begeo/デスクトップ/kernelmod.c:3:64: error: linux/module.h: No such file or directory
/home/begeo/デスクトップ/kernelmod.c:7: 警告: no previous prototype for ‘init_module’
/home/begeo/デスクトップ/kernelmod.c: In function ‘init_module’:
/home/begeo/デスクトップ/kernelmod.c:8: 警告: implicit declaration of function ‘printk’
/home/begeo/デスクトップ/kernelmod.c: トップレベル:
/home/begeo/デスクトップ/kernelmod.c:15: 警告: no previous prototype for ‘cleanup_module’
/home/begeo/デスクトップ/kernelmod.c: In function ‘cleanup_module’:
/home/begeo/デスクトップ/kernelmod.c:16: error: ‘KERN_ALERT’ undeclared (first use in this function)
/home/begeo/デスクトップ/kernelmod.c:16: error: (Each undeclared identifier is reported only once
/home/begeo/デスクトップ/kernelmod.c:16: error: for each function it appears in.)
/home/begeo/デスクトップ/kernelmod.c:16: error: expected ‘)’ before string constant

¿Ayuda?

PD: Estoy intentando usar el kernel de linu, compilando desde linux.

8
Visual Basic 6.0 e inferiores / Buscando A Alguien.
« en: Miércoles 9 de Mayo de 2007, 18:30 »
Saludos.

Soy una chica y tengo bastante interés en la programación dirigida a videojuegos, escribir, e idiomas.

En mi grupo de desarrollo, tenemos interés en lanzar una prebeta de nuestro juego para ir abriendo el apetito al público hasta que salga el motor que queremos usar.

El caso es que ninguno de nosotros sabemos suficiente VB6 (yo la que más, pero me quedo corta x_xU) para hacer el sistema clave sobre el motor que usaremos para la prebeta. He intentado hacerlo mediante el sistema de scripting del motor (SadScripting), pero me quedo corta con los comandos. He ido preguntando a varias personas que conozco cercanamente, pero por un motivo u otro no pueden. Pero me dejaron saber que hacerlo por el sistema de scripting seria muchisimo más duro que programarlo directamente sobre el motor.

¿Alguien se ofrece?

PD: Perdonen las molestias, no tengo costumbre de hacer de leecher x_xU

Páginas: [1]