Wie viele Einträge im Internet beweisen, bin ich nicht der einzige, der das alte Solitär-Spiel aus Windows XP mitgenommen hat und noch immer verwendet.
Die neueren Versionen von Microsoft konnten, trotz besserer Grafik, leider nicht mithalten.
Einfach Sol.exe und Cards.dll kopiert und man konnte auch mit den neuen Windowsversionen sein gewohntes Kartenspiel zeitvertreiben.
Leider hat die Classic-Version von Solitär eine fixe Auflösung der Spielkarten, was einem ungetrübten Spielspaß mit großer Bildschirmauflösung entgegenwirkt.
(Und nein, es ist NICHT die langsam einsetzende Altersweitsichtigkeit!! )
Ich hab nun aus diesem Grund meine eigene Cards.dll geschrieben.
Damit lässt sich die Große der Spielkarten ganz einfach anpassen.
In diesem Paket befinden sich alle nötigten Dateien (Sol.exe, Cards.dll, Cards.png, Cards.ini):
Download: Solitaire.7z
Die Cards.ini enthält die Auflösung der Spielkarten und kann leicht mit einem Texteditor bearbeitet werden.
Cards.png enthält die Spielkarten und könnte auch durch ein anderes Kartendeck, bzw. den wirklich originalen Rückseiten aus Windows 95 ersetzt werden.
Wer Angs vor Viren hat, kann sich die Sol.exe aus einem alten Windows(XP) kopieren und die Cards.dll selber kompilieren, hier ist der Freebasic-Sourcecode:
#Include Once "win\gdiplus.bi"
Using GDIPLUS
Dim Shared As Integer iGDIP_Cnt
Dim Shared As GdiplusStartupInput GDIP_SI
Dim Shared As ULong_Ptr GDIP_Token
Dim Shared As GpImage Ptr hIMG
Dim Shared As Integer iCardW, iCardH
iGDIP_Cnt = 0
Function _DrawCard(hDC As UInteger, iX As Integer, iY As Integer, iW As Integer, iH As Integer, iCard As Integer, iType As Integer, iColor As UInteger) As Integer
If iGDIP_Cnt < 1 Then Return 0
Dim As GpHatch Ptr hBRSH
Dim As GpGraphics Ptr hGFX
GdipCreateFromHDC(hDC, @hGFX)
Select Case iType
Case 1
Select Case iCard
Case 54 To 65
GdipDrawImageRectRectI(hGFX, hIMG, iX, iY, iW, iH, (iCard - 54) * 71, 96 * 4, 71, 96, 2, NULL, NULL, NULL)
End Select
Case 3
GdipDrawImageRectRectI(hGFX, hIMG, iX, iY, iW, iH, 12 * 71, 4 * 96, 71, 96, 2, NULL, NULL, NULL)
GdipCreateHatchBrush(44, &hFF000000, &hFF000000 Or iColor, @hBRSH)
GdipFillRectangleI(hGFX, hBRSH, iX+Int(iW / 35), iY+Int(iH / 48), iW-(Int(iW / 35)*2), iH-(Int(iH / 48)*2))
GdipDeleteBrush(hBRSH)
Case 7
GdipDrawImageRectRectI(hGFX, hIMG, iX, iY, iW, iH, 12 * 71, 4 * 96, 71, 96, 2, NULL, NULL, NULL)
Case Else
Select Case iCard
Case 0 To 51
GdipDrawImageRectRectI(hGFX, hIMG, iX, iY, iW, iH, Int(iCard / 4) * 71, Int(iCard Mod 4) * 96, 71, 96, 2, NULL, NULL, NULL)
End Select
End Select
GdipDeleteGraphics(hGFX)
Return 1
End Function
Extern "Windows-MS"
Function cdtInit(ByRef iW As Integer, ByRef iH As Integer) As Integer Export
iGDIP_Cnt += 1
If iGDIP_Cnt = 1 Then
GDIP_SI.GdiplusVersion = 1
GdiplusStartup(@GDIP_Token, @GDIP_SI, NULL)
GdipLoadImageFromFile(WStr(CurDir & "\cards.png"), @hIMG)
EndIf
Dim As Integer iValue
Dim As String sPath, sValue
sPath = CurDir & "\cards.ini"
iCardW = 71
iCardH = 96
Var hFile = FreeFile
If Open(sPath For Input As #hFile) = 0 Then
Line Input #hFile, sValue
iValue = Cast(Integer, sValue)
If iValue > 0 and iValue < 1000 Then iCardW = iValue
Line Input #hFile, sValue
iValue = Cast(Integer, sValue)
If iValue > 0 and iValue < 1000 Then iCardH = iValue
Close #hFile
EndIf
iW = iCardW
iH = iCardH
Return 1
End Function
Function cdtDraw(hDC As UInteger, iX As Integer, iY As Integer, iCard As Integer, iType As Integer, iColor As UInteger) As Integer Export
Return _DrawCard(hDC, iX, iY, iCardW, iCardH, iCard, iType, iColor)
End Function
Function cdtDrawExt(hDC As UInteger, iX As Integer, iY As Integer, iW As Integer, iH As Integer, iCard As Integer, iType As Integer, iColor As UInteger) As Integer Export
Return _DrawCard(hDC, iX, iY, iW, iH, iCard, iType, iColor)
End Function
Function cdtAnimate(hDC As UInteger, iCardBack As UInteger, iX As Integer, iY As Integer, iFrame As Integer) As Integer Export
Return 0
End Function
Sub cdtTerm Export
iGDIP_Cnt -= 1
If iGDIP_Cnt <= 0 Then
iGDIP_Cnt = 0
GdipDisposeImage(hIMG)
GdiplusShutdown(GDIP_Token)
EndIf
End Sub
End Extern
Alles anzeigen
Auch andere Klassiker benutzen die Cards.dll, jedoch hab ich noch nicht alle Funktionen korrekt umgesetzt - d.h. wahrscheinlich wird meine Version nicht zu 100% mit bsw. Spider-Solitär funktionieren.
Bei Bedarf kann ich das aber noch nachholen!
Viel Spaß
E