[Dev-C++] problem with Bitmap printing in Win98
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: John M. <j....@ch...> - 2004-02-27 20:18:15
|
Hi,
I have a strange problem which i am trying to solve for days now. I
really hope you can help me.
I am writing a program for Win98, 2000 and XP that reads text and
filenames from a plain file. The filenames correspond to pictures on the
local disc. The user can browse through the database and can view the
images, set them as wallpaper and print them.
On windows 2000 and XP the viewing, wallpaper and printing works fine.
In Windows 98 the viewing and wallpaper works, but when it comes to
printing only plank pages are produced.
I use the following code for full-page printing of a bitmap :
void Printer::DrawPage(wxDC *dc) {
int w, h;
float maxX = 1767;
float maxY = 2500;
float marginX = 10;
float marginY = 10;
maxX += (2*marginX);
maxY += (2*marginY);
dc->GetSize(&w, &h);
float scaleX=(float)(w/maxX);
float scaleY=(float)(h/maxY);
// Use x or y scaling factor, whichever fits on the DC
float actualScale = wxMin(scaleX,scaleY);
float posX = (float)((w - (maxX*actualScale))/2.0);
float posY = (float)((h - (maxY*actualScale))/2.0);
dc->SetUserScale(actualScale, actualScale);
dc->SetDeviceOrigin( (long)posX, (long)posY );
dc->DrawBitmap( *afbeelding, 0, 0, FALSE );
}
This code works in Win2000, and WinXP but NOT in Win98. When i add
DrawText the text is printed, the bitmap still isnot.
Kind regards,
John Melet
|