這是我的問題:我必須在Windows 7或更新的版本中移植一箇舊版本的Windows NT 4(我認爲)與舊版Borland。該程序運行良好(與依賴沃克沒有問題,應用程序驗證程序顯示一個錯誤的DEVMODE緩衝區,但這個錯誤存在於XP,它運作良好)。使用舊版Borland軟件模糊打印
該程序必須打印帶有一些信息的標籤,這在Windows XP上運行良好,但在七個數字是模糊的,我不知道爲什麼,我不知道如何解決這個問題。
我的打印機工作,因爲我可以完美地打印七個文本,如果我打印PDF打印機的問題仍然是相同的,所以我認爲這個問題是從Windows。
任何想法?
編輯1: 我有一些源代碼部分,但IDE中包含的部分丟失。 打印機不是因爲我想是因爲它是兩個測試,並還在這裏用PDF打印機
這裏的問題同樣是打印的源代碼:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <printers.hpp>
#include "FileCtrl.hpp"
#include "IniFileName.h"
#include "PrnEtiQ.h"
#include "CheckDll.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TEtiquette *Etiquette;
//---------------------------------------------------------------------------
__fastcall TEtiquette::TEtiquette(TComponent* Owner) : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TEtiquette::PrintEti(AnsiString Name,double OD,double OG,double xrb,int PrnIndex)
{
if (PrnIndex==-1) return;
TIniFile * pIni=new TIniFile(GetIniFileName());
if (pIni)
{
DecalX=pIni->ReadInteger("ETIQUETTE","Decal_X",150);
DecalY=pIni->ReadInteger("ETIQUETTE","Decal_Y",0);
pIni->WriteInteger("ETIQUETTE","Decal_X",DecalX);
pIni->WriteInteger("ETIQUETTE","Decal_Y",DecalY);
delete pIni;
}
else
{
DecalX=150;
DecalY=0;
}
LblName->Caption=Name;
PerimDroit->Caption=FormatFloat("##0.0000",OD);
PerimGauche->Caption=FormatFloat("##0.0000",OG);
XRB->Caption=FormatFloat("##0.00",xrb);
Printer()->PrinterIndex=PrnIndex;
int MemoWidth=Width;
int MemoHeight=Height;
Width=MemoWidth+DecalX;
Height=MemoHeight+DecalY;
Panel1->Left=DecalX;
Panel1->Top=DecalY;
Print();
Width=MemoWidth;
Height=MemoHeight;
Panel1->Left=0;
Panel1->Top=0;
}
//---------------------------------------------------------------------------
而這裏。其中描述標籤
object Etiquette: TEtiquette
Left = 167
Top = 149
HorzScrollBar.Visible = False
VertScrollBar.Visible = False
BorderIcons = []
BorderStyle = bsNone
ClientHeight = 33
ClientWidth = 142
Color = clWhite
UseDockManager = True
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial Black'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
PixelsPerInch = 96
TextHeight = 18
object Panel1: TPanel
Left = 0
Top = 0
Width = 143
Height = 34
BevelOuter = bvNone
Color = clWhite
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial Black'
Font.Style = []
ParentFont = False
TabOrder = 0
object PerimGauche: TLabel
Left = 4
Top = 0
Width = 65
Height = 11
AutoSize = False
Caption = '200.00'
Color = clWhite
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end
object PerimDroit: TLabel
Left = 72
Top = 0
Width = 66
Height = 11
Alignment = taRightJustify
AutoSize = False
Caption = '100.00'
Color = clWhite
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end
object XRB: TLabel
Left = 40
Top = 12
Width = 57
Height = 11
Alignment = taCenter
AutoSize = False
Caption = '123.45'
Color = clWhite
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end
object LblName: TLabel
Left = 4
Top = 20
Width = 42
Height = 14
Caption = '18241_1'
Color = clWhite
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentColor = False
ParentFont = False
end
end
end
的形狀,正如你所看到的,字體是硬編碼的,所以我不認爲這個問題是存在的futhermore我檢查的字體,他們是在同一個版本的DFM文件。
編輯2:https://drive.google.com/file/d/0B0AeGDmETlPXbGlPX3dUSG1WUzg/view?usp=sharing
我無法添加圖片:/ –
@FlorianGERARD 1.您可以某處張貼的圖片和帖子的鏈接到這裏有人會在這裏複製它。 2.查看源代碼後,我看到沒有打印代碼試圖在Printer() - > EndDoc()調用打印的某處查找「Printer()」函數體;'您的代碼只是移動/隱藏某些面板並調整打印時備忘(可能隱藏工具欄)。當你發現實際的打印程序攔截它的圖像時,看看問題是在渲染還是在打印本身。 – Spektre
@FlorianGERARD如果你處於可編譯狀態,那麼你可以在'Print();'行放置斷點並按F7進入它。你也正在訪問ini文件,所以確保你沒有小數點','ini文件裏面的問題...... – Spektre