VERSION 5.00
Begin VB.Form FormPrintMemoryBitmap 
   Caption         =   "Form1"
   ClientHeight    =   3000
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4560
   LinkTopic       =   "Form1"
   ScaleHeight     =   3000
   ScaleWidth      =   4560
   StartUpPosition =   3  'Windows の既定値
   Begin VB.TextBox Text1 
      Height          =   270
      Left            =   1200
      TabIndex        =   11
      Top             =   480
      Width           =   2175
   End
   Begin VB.CommandButton Command1 
      Caption         =   "発行"
      Height          =   495
      Left            =   1920
      TabIndex        =   2
      Top             =   2400
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "キャンセル"
      Height          =   495
      Left            =   3240
      TabIndex        =   1
      Top             =   2400
      Width           =   1215
   End
   Begin VB.TextBox Text3 
      Height          =   270
      Left            =   1200
      TabIndex        =   0
      Top             =   1560
      Width           =   1335
   End
   Begin VB.Label Label2 
      BorderStyle     =   1  '実線
      Caption         =   "PTR_BMT_BMP = -1"
      Height          =   255
      Index           =   4
      Left            =   1200
      TabIndex        =   12
      Top             =   840
      Width           =   2175
   End
   Begin VB.Label Label2 
      BorderStyle     =   1  '実線
      Caption         =   "PTR_BM_ASIS = -11"
      Height          =   255
      Index           =   3
      Left            =   1200
      TabIndex        =   10
      Top             =   1200
      Width           =   2175
   End
   Begin VB.Label Label2 
      BorderStyle     =   1  '実線
      Caption         =   "Type"
      Height          =   255
      Index           =   2
      Left            =   120
      TabIndex        =   9
      Top             =   840
      Width           =   975
   End
   Begin VB.Label Label2 
      BorderStyle     =   1  '実線
      Caption         =   "Bitmap File"
      Height          =   255
      Index           =   1
      Left            =   120
      TabIndex        =   8
      Top             =   480
      Width           =   975
   End
   Begin VB.Label Label2 
      BorderStyle     =   1  '実線
      Caption         =   "Width"
      Height          =   255
      Index           =   0
      Left            =   120
      TabIndex        =   7
      Top             =   1200
      Width           =   975
   End
   Begin VB.Label Label1 
      BorderStyle     =   1  '実線
      Caption         =   "Alignment"
      Height          =   255
      Left            =   120
      TabIndex        =   6
      Top             =   1560
      Width           =   975
   End
   Begin VB.Label Label5 
      Caption         =   "PTR_BM_LEFT=-1"
      Height          =   195
      Left            =   2640
      TabIndex        =   5
      Top             =   1560
      Width           =   1635
   End
   Begin VB.Label Label6 
      Caption         =   "PTR_BM_CENTER=-2"
      Height          =   195
      Left            =   2640
      TabIndex        =   4
      Top             =   1800
      Width           =   1635
   End
   Begin VB.Label Label7 
      Caption         =   "PTR_BM_RIGHT=-3"
      Height          =   195
      Left            =   2640
      TabIndex        =   3
      Top             =   2040
      Width           =   1635
   End
End
Attribute VB_Name = "FormPrintMemoryBitmap"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()

    Dim filename As String
    Dim alignment As Long
    Dim ret As Long
    Dim i As Long
    Dim j As Long
    Dim length As Long
    Dim BC_mode As Long
    Dim data As String
    '
    BC_mode = OPOS_BC_DECIMAL  'OPOS_BC_NIBBLE
    j = 0
    filename = Text1
    alignment = Text3
    length = FileLen(filename)

'=====ビットマップファイルを変数に読み込む
    Dim Chg_Bitmap() As Byte
    Dim Bitmap()     As Byte
    FileNumber = FreeFile
    
    Open filename For Binary Access Read As FileNumber
    ReDim Bitmap(FileLen(filename))
    Bitmap() = InputB(length, FileNumber)
    Close FileNumber
    
    ReDim Chg_Bitmap(FileLen(filename) * 3)
    
    For i = 0 To (length - 1)
        data = tp_BinaryConversion(BC_mode, Bitmap(i))
        
        rtn_l = PPW_BinaryConversion(BC_mode)
        If rtn_l <> OPOS_SUCCESS Then err = True
        
        Chg_Bitmap(j) = Mid$(data, 3, 1)
        j = j + 1
        Chg_Bitmap(j) = Mid$(data, 2, 1)
        j = j + 1
        Chg_Bitmap(j) = Mid$(data, 1, 1)
        j = j + 1
        
        rtn_l = PPW_BinaryConversion(OPOS_BC_NONE)
        If rtn_l <> OPOS_SUCCESS Then err = True
    Next i


'=====メモリービットマップ印刷関数をコール
    rtn_l = PM_PrintMemoryBitmap(PTR_S_RECEIPT, Chg_Bitmap, PTR_BMT_BMP, PTR_BM_ASIS, alignment)
    If rtn_l <> OPOS_SUCCESS Then err = True
    Call Msg_Box(err)
    
    Me.Hide


End Sub

Private Sub Command2_Click()

    Me.Hide

End Sub


