π
<-

[Z80] Convertisseur image en ASM.

Nouveautés, projets, mises à jour.

Re: [Z80] Convertisseur image en ASM.

Messagede kindermoumoute » 09 Juil 2010, 20:57

Ouai en gros on peut le mettre ici direct :
 
Show/Hide spoilerAfficher/Masquer le spoiler
Code: Tout sélectionner
Public Class Form1
    'Convertisseur ASM TI-83 / TI-83+
    'Logiciel de Alexis Jehan
    'espace-ti.e-monsite.com
    'Version 2.2

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        OpenFileDialog1.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyPictures
    End Sub
    Dim bmp0, bm As Bitmap
    Dim gen As Boolean = False
    Public imgChargee As Boolean = False
    Private Sub Generer(ByVal bmp As Bitmap, Optional ByVal separer As Boolean = False)
        Dim Str1 As String = "21369311298E010003EDB0CD6451C9"
        Dim Str7 As String = "0123456789ABCDEF "
        Dim Str8 As String = ""
        Dim D As Integer = 0
        Dim I As Integer = 0
        Dim X As Integer = 0
        Dim Z As Integer = 0
        If TI83.Checked Then
            Str1 = "21369311298E010003EDB0CD6451C9"
        ElseIf TI83plus.Checked Then
            Str1 = "21A49D114093010003EDB0CD6451C9"
        End If
        If Blanche.Checked Then
            Z = 0
        ElseIf Noire.Checked Then
            Z = 1
        End If
        For A = 0 To 62
            For B = 0 To 10
                X = 0
                For C = 7 To 0 Step -1
                    If bmp.GetPixel(8 * B + 7 - C, A).ToArgb = Color.Black.ToArgb Then
                        X += 2 ^ C
                    End If
                Next C
                If X = 0 Then
                    Str8 = "00"
                End If
                If X = 255 Then
                    Str8 = "FF"
                End If
                If X  0 And X  255 Then
                    I = X
                    Str8 = "."
                    While I  0
                        D = 16 * (I / 16 - Int(I / 16))
                        I = Int(I / 16)
                        Str8 = Mid(Str7, D + 1, 1)  Str8
                    End While
                    Str8 = Mid(Str8, 1, Str8.Length() - 1)
                    If X = 15 Then
                        Str8 = "0"  Str8
                    End If
                End If
                Str1 = Str8
            Next B
            X = 0
            For B = 88 To 94
                If bmp.GetPixel(B, A).ToArgb = Color.Black.ToArgb Then
                    X += 2 ^ (7 - (B - 88))
                End If
            Next B
            X += Z
            If X = 0 Then
                Str8 = "00"
            End If
            If X = 255 Then
                Str8 = "FF"
            End If
            If X  0 And X  255 Then
                I = X
                Str8 = "."
                While I  0
                    D = 16 * (I / 16 - Int(I / 16))
                    I = Int(I / 16)
                    Str8 = Mid(Str7, D + 1, 1)  Str8
                End While
                Str8 = Mid(Str8, 1, Str8.Length() - 1)
                If X = 15 Then
                    Str8 = "0"  Str8
                End If
            End If
            Str1 = Str8
        Next A
        If Z = 1 Then
            Str8 = "FF"
        Else
            Str8 = "00"
        End If
        For A = 0 To 11
            Str1 = Str8
        Next A
        If TI83.Checked Then
            TextBox1.Text = Str1  vbCrLf  "End"  vbCrLf  "0000"  vbCrLf  "End"
        ElseIf TI83plus.Checked Then
            TextBox1.Text = "AsmPrgm"  vbCrLf  Str1
        End If
    End Sub
    Public Sub genVerif()
        If imgChargee AndAlso gen Then Generer(PictureBox1.Image, CheckBox1.Checked)
    End Sub
    Private Function version() As String
        With System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly.Location)
            If .FileBuildPart = 0 Then
                If .FilePrivatePart = 0 Then
                    version = .FileMajorPart  "."  .FileMinorPart
                Else
                    version = .FileMajorPart  "."  .FileMinorPart  "."  .FileBuildPart  "."  .FilePrivatePart
                End If
            Else
                If .FilePrivatePart = 0 Then
                    version = .FileMajorPart  "."  .FileMinorPart  "."  .FileBuildPart
                Else
                    version = .FileMajorPart  "."  .FileMinorPart  "."  .FileBuildPart  "."  .FilePrivatePart
                End If
            End If
        End With
    End Function
    Private Sub b_Generer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_Generer.Click
        If Not imgChargee Then
            MsgBox("Sélectionnez une image.", MsgBoxStyle.Critical, "Erreur")
            Exit Sub
        End If
        Generer(PictureBox1.Image, CheckBox1.Checked)
        gen = True
    End Sub
    Private Sub b_Copier1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_Copier1.Click
        If TextBox1.Text = "" Then
            MsgBox("Générez d'abord le programme.", MsgBoxStyle.Critical, "Erreur")
        Else
            Clipboard.SetText(TextBox1.Text)
        End If
    End Sub
    Private Sub b_Ouvrir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_Ouvrir.Click
        If Not OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then Exit Sub
        Try
            bmp0 = New Bitmap(OpenFileDialog1.FileName)
        Catch
            MsgBox("Image non valide.", MsgBoxStyle.Critical, "Erreur")
            Exit Sub
        End Try
        Dim z As Bitmap = New Bitmap(95, 63)
        Dim g As Graphics = Graphics.FromImage(z)
        g.DrawImage(bmp0, New Rectangle(0, 0, z.Width, z.Height))
        bmp0 = z
        TextBox1.Text = ""
        CheckBox2.Checked = False
        gen = False
        PictureBox1.Image = New Bitmap(BMP2Mono(bmp0, TrackBar1.Value / TrackBar1.Maximum))
        bmp0.Dispose()
        imgChargee = True
        b_Generer.Select()
    End Sub
    Private Sub TextBox_KeyDown(ByVal sender As TextBox, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
        If e.Control AndAlso e.KeyCode = Keys.A Then
            sender.SelectAll()
            e.SuppressKeyPress = True
        End If
    End Sub
    Private Function BMP2Mono(ByVal img As Bitmap, Optional ByVal sens As Double = 0.5) As Bitmap
        Using bm As New Bitmap(img.Width, img.Height)
            For y = 0 To img.Height - 1
                For x = 0 To img.Width - 1
                    If img.GetPixel(x, y).GetBrightness = sens Then
                        bm.SetPixel(x, y, Color.White)
                    Else
                        bm.SetPixel(x, y, Color.Black)
                    End If
            Next x, y
            img.Dispose()
            BMP2Mono = New Bitmap(bm)
            bm.Dispose()
        End Using
    End Function
    Private Sub TrackBar1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.ValueChanged
        Label1.Text = "Sensibilité: "  CDbl(TrackBar1.Value / TrackBar1.Maximum).ToString
        If imgChargee Then
            bmp0 = New Bitmap(OpenFileDialog1.FileName)
            Dim z As Bitmap = New Bitmap(95, 63)
            Dim l As Graphics = Graphics.FromImage(z)
            l.DrawImage(bmp0, New Rectangle(0, 0, z.Width, z.Height))
            bmp0 = z
            PictureBox1.Image = bmp0
            PictureBox1.Image = New Bitmap(BMP2Mono(bmp0, TrackBar1.Value / TrackBar1.Maximum))
            If CheckBox2.Checked Then
                Try
                    Dim img As Bitmap = New Bitmap(PictureBox1.Image)
                    Dim c As Color
                    Dim i As Integer = 0
                    Do While (i  img.Width)
                        Dim j As Integer = 0
                        Do While (j  img.Height)
                            c = img.GetPixel(i, j)
                            Dim r As Integer = 0
                            r = Convert.ToInt16(c.R)
                            Dim g As Integer = 0
                            g = Convert.ToInt16(c.G)
                            Dim b As Integer = 0
                            b = Convert.ToInt16(c.B)
                            Dim newr As Integer = 0
                            newr = (255 - r)
                            Dim newg As Integer = 0
                            newg = (255 - g)
                            Dim newb As Integer = 0
                            newb = (255 - b)
                            c = Color.FromArgb(newr, newg, newb)
                            img.SetPixel(i, j, c)
                            j = (j + 1)
                        Loop
                        i = (i + 1)
                    Loop
                    PictureBox1.Image = img
                Catch ex As Exception
                    MsgBox("Sélectionnez une image.", MsgBoxStyle.Critical, "Erreur")
                End Try
            End If
            PictureBox1.Refresh()
            Label1.Refresh()
            bmp0.Dispose()
        End If
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MsgBox("Convertisseur Image ASM TI-83 / TI-83+"  vbCrLf  "Logiciel de Alexis Jehan."  vbCrLf  "Merci à M@T pour le script."  vbCrLf  ""  vbCrLf  "espace-ti.e-monsite.com"  vbCrLf  ""  vbCrLf  "Version 2.2", MsgBoxStyle.Information, "A propos")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        MsgBox("Pour exécuter le programme:"  vbCrLf  vbCrLf  "- Sur TI-82 Stats / TI-83:"  vbCrLf  "Envoi(9prgmNOM) / Send(9prgmNOM)"  vbCrLf  vbCrLf  "- Sur TI-83+ / TI-84+:"  vbCrLf  "AsmComp(prgmNOM,prgmNOM2)"  vbCrLf  "Asm(prgmNOM2)", MsgBoxStyle.Information, "Infos")
    End Sub
    Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        System.Diagnostics.Process.Start("http://espace-ti.e-monsite.com/")
    End Sub
    Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
        Try
            Dim img As Bitmap = New Bitmap(PictureBox1.Image)
            Dim c As Color
            Dim i As Integer = 0
            Do While (i  img.Width)
                Dim j As Integer = 0
                Do While (j  img.Height)
                    c = img.GetPixel(i, j)
                    Dim r As Integer = 0
                    r = Convert.ToInt16(c.R)
                    Dim g As Integer = 0
                    g = Convert.ToInt16(c.G)
                    Dim b As Integer = 0
                    b = Convert.ToInt16(c.B)
                    Dim newr As Integer = 0
                    newr = (255 - r)
                    Dim newg As Integer = 0
                    newg = (255 - g)
                    Dim newb As Integer = 0
                    newb = (255 - b)
                    c = Color.FromArgb(newr, newg, newb)
                    img.SetPixel(i, j, c)
                    j = (j + 1)
                Loop
                i = (i + 1)
            Loop
            PictureBox1.Image = img
        Catch ex As Exception
            If CheckBox2.Checked = True Then
                MsgBox("Sélectionnez une image.", MsgBoxStyle.Critical, "Erreur")
                CheckBox2.Checked = False
            End If
        End Try
    End Sub
End Class


EDIT : Je n'y comprend rien au VB .net, mais il faudrait voir si tu peut mettre une variable (multiple de 4) au lieu d'une constante pour 94 pixels
Tutoriel sur l'axe parser, un langage de programmation pour z80 ultra rapide et beaucoup plus facile que l'ASM !
Avatar de l’utilisateur
kindermoumouteProgrammeur
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Prochain niv.: 2.6%
 
Messages: 849
Inscription: 30 Sep 2009, 00:00
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: Ecole d'ingénieur informatique et industriel

Image ASM Mac

Messagede bonjour666 » 13 Mar 2011, 15:50

Est-il possible d'avoir un programme pareil pour Mac? Parce que ça m'intéresse beaucoup.
Avatar de l’utilisateur
bonjour666
Niveau 4: MC (Membre Confirmé)
Niveau 4: MC (Membre Confirmé)
Prochain niv.: 8%
 
Messages: 26
Inscription: 11 Mar 2011, 00:00
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: seconde

Re: [Z80] Convertisseur image en ASM.

Messagede alexvire » 13 Mar 2011, 16:24

Désolé je n'en connais pas pour MAC et je ne sais absolument pas comment faire pour convertir le mien pour MAC.

Mais il n'existe pas un logiciel MAC pour faire tourner des fichiers ".exe" de Windows ?
Salut ClaudeBot [spider], visite mon site:
Image
Et mon forum !
Merci !

Mes projets: Image Image Image
Avatar de l’utilisateur
alexvire
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Prochain niv.: 14.1%
 
Messages: 109
Inscription: 18 Avr 2010, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: [Z80] Convertisseur image en ASM.

Messagede kindermoumoute » 13 Mar 2011, 16:29

wine.
Tutoriel sur l'axe parser, un langage de programmation pour z80 ultra rapide et beaucoup plus facile que l'ASM !
Avatar de l’utilisateur
kindermoumouteProgrammeur
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Prochain niv.: 2.6%
 
Messages: 849
Inscription: 30 Sep 2009, 00:00
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: Ecole d'ingénieur informatique et industriel

Re: [Z80] Convertisseur image en ASM.

Messagede bonjour666 » 13 Mar 2011, 16:31

Oui je connait mais j'ai peur de chopper des virus windows si je le télécharge.
Avatar de l’utilisateur
bonjour666
Niveau 4: MC (Membre Confirmé)
Niveau 4: MC (Membre Confirmé)
Prochain niv.: 8%
 
Messages: 26
Inscription: 11 Mar 2011, 00:00
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: seconde

Re: [Z80] Convertisseur image en ASM.

Messagede alexvire » 13 Mar 2011, 16:36

Dans ce cas tu peux peut être en trouver ici.
Salut ClaudeBot [spider], visite mon site:
Image
Et mon forum !
Merci !

Mes projets: Image Image Image
Avatar de l’utilisateur
alexvire
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Prochain niv.: 14.1%
 
Messages: 109
Inscription: 18 Avr 2010, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: [Z80] Convertisseur image en ASM.

Messagede Lionel Debroux » 13 Mar 2011, 16:37

Oui je connait mais j'ai peur de chopper des virus windows si je le télécharge.

A moins que tu lances explicitement dans Wine un programme qui contient déjà  des virus Windows (qui sont loin de tous fonctionner dans Wine), aucun risque :):
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
Avatar de l’utilisateur
Lionel DebrouxSuper Modo
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Prochain niv.: 11.4%
 
Messages: 6875
Inscription: 23 Déc 2009, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: -
GitHub: debrouxl

Re: [Z80] Convertisseur image en ASM.

Messagede bonjour666 » 13 Mar 2011, 16:38

Non j'ai déjà regarder mais je viens d'en trouver un en ligne qui marche très bien:
http://ti.zewaren.net/en/index.php
Avatar de l’utilisateur
bonjour666
Niveau 4: MC (Membre Confirmé)
Niveau 4: MC (Membre Confirmé)
Prochain niv.: 8%
 
Messages: 26
Inscription: 11 Mar 2011, 00:00
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: seconde

Précédente

Retourner vers Actualités

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 6 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
Ndless for CX 4.5.5 / CX II 6.2.0
Comparaisons des meilleurs prix pour acheter sa calculatrice !
"1 calculatrice pour tous", le programme solidaire de Texas Instruments. Reçois gratuitement et sans aucune obligation d'achat, 5 calculatrices couleur programmables en Python à donner aux élèves les plus nécessiteux de ton lycée. Tu peux recevoir au choix 5 TI-82 Advanced Edition Python ou bien 5 TI-83 Premium CE Edition Python.
Enseignant(e), reçois gratuitement 1 exemplaire de test de la TI-82 Advanced Edition Python. À demander d'ici le 31 décembre 2024.
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
12345
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
3231 utilisateurs:
>3198 invités
>25 membres
>8 robots
Record simultané (sur 6 mois):
32248 utilisateurs (le 01/09/2025)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)