473,698 Members | 2,503 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printing images utilizing entire paper area.

I am trying to print huge images (much bigger than target paper). I try
and use e.PageSettings. HardMarginX and e.PageSettings. HardMarginY in the
PrintDocument's PrintPage event to try and determine the maximum area
that I can print on. However, the edge of the image invariably gets cut
off, as if the HardMargin info is wrong. I posted the code below as I
can't understand what I am doing wrong. Is information in
e.PageSettings reliable?
public void Print()
{
if (PicBox.Image.H eight <= PicBox.Image.Wi dth)
printImage.Defa ultPageSettings .Landscape = true;
else
printImage.Defa ultPageSettings .Landscape = false;

printImage.Prin t();
}

private void printImage_Prin tPage(object sender,
System.Drawing. Printing.PrintP ageEventArgs e)
{
// depending on the size of the image,
// we might have to constrain
// the width and height or neither

// if we constrain width, we must proportionately
// constrain the height as well and vice versa

//Rectangle printRectangle = e.PageBounds;
float widthConstraint Ratio = 0;
float heightConstrain tRatio = 0;
float commonConstrain tRatio = 0;

// increase the hard margin just for safety.
float hardMarginX = e.PageSettings. HardMarginX;
float hardMarginY = e.PageSettings. HardMarginY;

RectangleF printRectangle = new RectangleF(
hardMarginX,
hardMarginY,
e.PageBounds.Wi dth - (hardMarginX * 2),
e.PageBounds.He ight - (hardMarginY * 2));
if (printRectangle .Width < PicBox.Width)
widthConstraint Ratio =
(float)printRec tangle.Width / (float)PicBox.W idth;

if (printRectangle .Height < PicBox.Height)
heightConstrain tRatio =
(float)printRec tangle.Height / (float)PicBox.H eight;
if (widthConstrain tRatio 0 && heightConstrain tRatio 0)
{
if (widthConstrain tRatio >= heightConstrain tRatio)
commonConstrain tRatio = heightConstrain tRatio;
else
commonConstrain tRatio = widthConstraint Ratio;
}
else if (widthConstrain tRatio 0 &&
heightConstrain tRatio == 0)
commonConstrain tRatio = widthConstraint Ratio;

else if (widthConstrain tRatio == 0 &&
heightConstrain tRatio 0)
commonConstrain tRatio = heightConstrain tRatio;

if (commonConstrai ntRatio 0)
{
printRectangle. Height =
PicBox.Height * commonConstrain tRatio;
printRectangle. Width =
PicBox.Width * commonConstrain tRatio;
}

e.Graphics.Draw Image(PicBox.Im age, printRectangle) ;
e.HasMorePages = false;
}
May 24 '07 #1
8 9002
On Wed, 23 May 2007 17:31:15 -0700, Frank Rizzo <no**@none.comw rote:
I am trying to print huge images (much bigger than target paper). I try
and use e.PageSettings. HardMarginX and e.PageSettings. HardMarginY in the
PrintDocument's PrintPage event to try and determine the maximum area
that I can print on. However, the edge of the image invariably gets cut
off, as if the HardMargin info is wrong. I posted the code below as I
can't understand what I am doing wrong. Is information in
e.PageSettings reliable?
I have to admit, I spent several years of my programming career
maintaining the printing code for a well-known productivity application,
and somehow managed to get through all that without ever hearing the term
"hard margin". Unfortunately, the MSDN documentation doesn't at all help
to explain what the HardMarginX and HardMarginY properties represent.

What I do know is that you can't completely describe the area on the page
that the printer can't print to with just two numbers. Many ink jet
printers in particular have asymmetrical physical margins (which is whatI
suppose they are now calling "hard margins"), and you need a complete
rectangle to describe that. I think it's possible that you're running
into an issue where the "hard margins" properties are describing correctly
one side of the page, but not the other.

Fortunately, in PageSettings there is a PrintableArea property that ought
to be what I'm familiar with as the actual area on the page that the
printer can physically print to. It *seems* like you ought to be able to
use that to accomplish what you want.

Of course, I'll also note that there is a MarginBounds property for the
PrintPageEventA rgs that represents the margins set by the user. It seems
to me that's a more appropriate boundary to use to restrict your output
anyway. :) The printable area is more commonly used to restrict the
user's choice of margins, rather than being used as margins themselves.

Finally, if I may, I'd like to offer a simpler way to calculate your final
"commonConstrai ntRatio" value:

float widthConstraint Ratio, heightConstrain tRatio,
commonConstrain tRatio;

widthConstraint Ratio = (float)printRec tangle.Width / PixBox.Width;
heightConstrain tRatio = (float)printRec tangle.Height / PixBox.Height;

commonConstrain tRatio = Math.Min(1.0f, Math.Min(widthC onstraintRatio,
heightConstaint Ratio));
printRectangle = new RectangleF(prin tRectangle.Loca tion, new
SizeF(PixBox.Wi dth * commonConstrain tRatio, PixBox.Height *
commonConstrain tRatio));

I'll also point out that in the code you posted, if the image you're
printing actually fits entirely within the printRectangle you calculate to
start, you never wind up incorporating the PixBox dimensions into the size
of the printRectangle, which would mess up the output aspect ratio of your
printed image.

Pete
May 24 '07 #2
Hi Frank,

The hard margin specified by the
PrintPageEventA rgs.PageSetting s.HardMarginX or HardMarginY represents the
physical margin set by the printer.

When we need to get the area on a page that can be printed on, we usually
use PrintPageEventA rgs.MarginBound s property, which get the rectangle area
that represents the portion of the page inside the margins.

Hope this helps.

Sincerely,
Linda Liu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

May 24 '07 #3
As far as I understand, HardMargins represent the max area that the
printer is capable of. Also, thanks for the simplified code. I was
unaware of the Math class.

However, the if I use PrintableArea is basicaly a wrapper around
HardMargins (e.g. displays the same values), so the image still cuts off.

I can't use MarginBounds because it wastes too much of the paper and the
users can't specify margins anyway (it's a kiosk application).

I basically added 25 pixels to the hard margins and that seems to work
ok every time, even though it seems like a hack.

float hardMarginX = e.PageSettings. HardMarginX + 25;
float hardMarginY = e.PageSettings. HardMarginY + 25;

RectangleF printRectangle = new RectangleF(
hardMarginX,
hardMarginY,
e.PageBounds.Wi dth - (hardMarginX * 2),
e.PageBounds.He ight - (hardMarginY * 2));

Regards

Peter Duniho wrote:
On Wed, 23 May 2007 17:31:15 -0700, Frank Rizzo <no**@none.comw rote:
>I am trying to print huge images (much bigger than target paper). I
try and use e.PageSettings. HardMarginX and e.PageSettings. HardMarginY
in the PrintDocument's PrintPage event to try and determine the
maximum area that I can print on. However, the edge of the image
invariably gets cut off, as if the HardMargin info is wrong. I posted
the code below as I can't understand what I am doing wrong. Is
information in e.PageSettings reliable?

I have to admit, I spent several years of my programming career
maintaining the printing code for a well-known productivity application,
and somehow managed to get through all that without ever hearing the
term "hard margin". Unfortunately, the MSDN documentation doesn't at
all help to explain what the HardMarginX and HardMarginY properties
represent.

What I do know is that you can't completely describe the area on the
page that the printer can't print to with just two numbers. Many ink
jet printers in particular have asymmetrical physical margins (which is
what I suppose they are now calling "hard margins"), and you need a
complete rectangle to describe that. I think it's possible that you're
running into an issue where the "hard margins" properties are describing
correctly one side of the page, but not the other.

Fortunately, in PageSettings there is a PrintableArea property that
ought to be what I'm familiar with as the actual area on the page that
the printer can physically print to. It *seems* like you ought to be
able to use that to accomplish what you want.

Of course, I'll also note that there is a MarginBounds property for the
PrintPageEventA rgs that represents the margins set by the user. It
seems to me that's a more appropriate boundary to use to restrict your
output anyway. :) The printable area is more commonly used to restrict
the user's choice of margins, rather than being used as margins themselves.

Finally, if I may, I'd like to offer a simpler way to calculate your
final "commonConstrai ntRatio" value:

float widthConstraint Ratio, heightConstrain tRatio,
commonConstrain tRatio;

widthConstraint Ratio = (float)printRec tangle.Width / PixBox.Width;
heightConstrain tRatio = (float)printRec tangle.Height / PixBox.Height;

commonConstrain tRatio = Math.Min(1.0f,
Math.Min(widthC onstraintRatio, heightConstaint Ratio));
printRectangle = new RectangleF(prin tRectangle.Loca tion, new
SizeF(PixBox.Wi dth * commonConstrain tRatio, PixBox.Height *
commonConstrain tRatio));

I'll also point out that in the code you posted, if the image you're
printing actually fits entirely within the printRectangle you calculate
to start, you never wind up incorporating the PixBox dimensions into the
size of the printRectangle, which would mess up the output aspect ratio
of your printed image.

Pete
May 25 '07 #4
On Fri, 25 May 2007 12:00:02 -0700, Frank Rizzo <no**@none.comw rote:
As far as I understand, HardMargins represent the max area that the
printer is capable of. Also, thanks for the simplified code. I was
unaware of the Math class.

However, the if I use PrintableArea is basicaly a wrapper around
HardMargins (e.g. displays the same values), so the image still cuts off.
I assure you that at least for many printers (ink jet printers in
particular), PrintableArea definitely does not just "wrap" the HardMarginX
and HardMarginY properties. As I said, the printable area can be
asymmetrical, and so two values cannot completely describe the printable
area.

That said, if you are seeing values in PrintableArea that *are* exactly
the same as obtained through the HardMarginX/Y properties, then at least
for that printer there is obviously a correlation and I would agree that
you should be able to use them as a reliable indication of where the
printer can actually print to.
I can't use MarginBounds because it wastes too much of the paper and the
users can't specify margins anyway (it's a kiosk application).
Well, you could specify the margins in code. Doing so would make your
code more reusable (in that if a UI did get added where the user could
specify margins, it would just work). But I suppose if you want to be
tied to the printer hardware, that's certainly a design choice you can
make.
I basically added 25 pixels to the hard margins and that seems to work
ok every time, even though it seems like a hack.
It is a hack. You might consider looking at other possibilities (I wish I
had more direct experience with the .NET printing stuff...a lot of this I
should know off the top of my head, but simply don't). For example, make
sure that your output is not being automatically clipped to the
MarginBounds rectangle to start with. Also, make sure that the origin for
drawing is where you expect it to be. These are things that could make it
appear as though the HardMarginX/Y properties are unreliable, when in fact
they are just being misinterpreted or don't tell the whole story.

Pete
May 25 '07 #5
Peter Duniho wrote:
>I basically added 25 pixels to the hard margins and that seems to work
ok every time, even though it seems like a hack.

It is a hack. You might consider looking at other possibilities (I wish
I had more direct experience with the .NET printing stuff...a lot of
this I should know off the top of my head, but simply don't). For
example, make sure that your output is not being automatically clipped
to the MarginBounds rectangle to start with. Also, make sure that the
origin for drawing is where you expect it to be. These are things that
could make it appear as though the HardMarginX/Y properties are
unreliable, when in fact they are just being misinterpreted or don't
tell the whole story.
Pete, you are absolutely right - I just noticed it today. The output is
being clipped at top and left, but not bottom and right. E.g. the
output starts at about the coordinates, specified by MarginBounds
property. How do I work around that? I am just doing

e.Graphics.Draw Image(PicBox.Im age, printRectangle) ;

Is there something I can do to make sure that the output is not clipped.
May 30 '07 #6
On Tue, 29 May 2007 21:31:28 -0700, Frank Rizzo <no**@none.netw rote:
Pete, you are absolutely right - I just noticed it today. The output is
being clipped at top and left, but not bottom and right. E.g. the
output starts at about the coordinates, specified by MarginBounds
property. How do I work around that? I am just doing

e.Graphics.Draw Image(PicBox.Im age, printRectangle) ;

Is there something I can do to make sure that the output is not clipped.
I wish I had time to play with this printing stuff right now, but
unfortunately I don't. So any advice I offer is going to be vague. I
apologize in advance for that.

But, based on what you've written so far, it sure seems likely to be that
the Graphics getting passed to you in the PrintPage event handler has been
preset to clip to the MarginBounds set in the print job.

I will reiterate my suggestion that it is better to use the PrintableArea
property to determine where the physical limits of the printer are. I see
two possibilities when the printer has asymmetrical physical margings:
either the "HardMargin X/Y" properties are conservative and take the larger
of the two edge margins in each direction, or they are not and take the
smaller. In the former case, you will not actually be using the full
available area for printing, and in the latter case your output may still
wind up getting clipped. The PrintableArea property gives you a complete
description of where the printer is actually able to print, and IMHO is
what should be used.

Frankly, it's not clear to me why Microsoft even included the
"HardMargin X/Y" properties, given this limitation. But then, I have a bit
of history with them misinterpreting suggestions from application
developers and doing strange things with the printing API based on those
suggestions. So my guess is that they meant well, even if the end results
was odd. :)

Anyway, that said, to correct the issue you're seeing, I see a couple of
possibilities. One is to mess with the clipping. You can remove the
clipping before drawing, by setting the Graphics.Clip property to a
default Region instance ("new Region()"). Alternatively, you could use
the PrintableArea property as the parameter to the Graphics.SetCli p()
method, so that the clipping region equals the printable area.

IMHO, the second and somewhat better solution would be to change the code
so that rather than looking at the printable area to decide where to draw,
use the margins. Then just make sure that you explicitly set the margins
so that they match the printable area before you start printing. I feel
this is better for reasons that I brought up before: the margins are
really what are normally used for determining where to print, and if and
when the code allows for the user to adjust the margins themselves, then
nothing else needs to be changed. This also avoids having to worry about
any behind-the-scenes clipping that the printer driver might be doing
based on the margins and which you can't override using the Clip property
of the printing Graphics instance you get in the PrintPage handler.

Hope that helps.

Pete
May 30 '07 #7
Peter Duniho wrote: On Tue, 29 May 2007 21:31:28 -0700, Frank Rizzo &lt;no**@none.n et&gt; wrote:

Pete, you are absolutely right - I just noticed it today.Â* The output is being clipped at top and left, but not bottom and right.Â* E.g. the output starts at about the coordinates, specified by MarginBounds property. How do I work around that?Â* I am just doing

Â*Â*Â*Â*e.Graph ics.DrawImage(P icBox.Image, printRectangle) ;

Is there something I can do to make sure that the output is not clipped. First off, sorry for non-text mode of this post - the code looks like crap that way.
I figured the problem out with the help of an individual from MS Support.Â* Basically forget about all the values in e.PageBounds or e.PageSettings. PrintableArea. * You have to drop down to the WinAPI to get what you need.Â* First off, the top left your print are will start atÂ* 0,0 , not the HardMargins.Â* And height and width can be gotten via GetDeviceCaps. * Here is the entire code below, including a class to retrieve the data from WinAPI:

private void printImage_Prin tPage(object sender, System.Drawing. Printing.PrintP ageEventArgs e)
{
Â*Â*Â* // depending on the size of the image, we might have to constrainÂ*
Â*Â*Â* // the width and height or neither
Â*
Â*Â*Â* // if we constrain width, we must proportionately
Â*Â*Â* // constrain the height as well and vice versa

Â*Â*Â* float widthConstraint Ratio = 0;
Â*Â*Â* float heightConstrain tRatio = 0;
Â*Â*Â* float commonConstrain tRatio = 0;
Â*
Â*Â*Â* PrinterBounds pb = new PrinterBounds(e );
Â*Â*Â* RectangleF printRectangle = new RectangleF(0, 0, pb.Width, pb.Height);
Â*
Â*Â*Â* if (printRectangle .Width &lt; PicBox.Width)
Â*Â*Â*Â*Â*Â*Â* widthConstraint Ratio = (float)printRec tangle.Width / (float)PicBox.W idth;
Â*Â*Â*
Â*Â*Â* if (printRectangle .Height &lt; PicBox.Height)
Â*Â*Â*Â*Â*Â*Â* heightConstrain tRatio = (float)printRec tangle.Height / (float)PicBox.H eight;
Â*
Â*
Â*Â*Â* if (widthConstrain tRatio &gt; 0 &amp;&amp; heightConstrain tRatio &gt; 0)
Â*Â*Â* {
Â*Â*Â*Â*Â*Â*Â* if (widthConstrain tRatio &gt;= heightConstrain tRatio)
Â*Â*Â*Â*Â*Â*Â*Â *Â*Â*Â* commonConstrain tRatio = heightConstrain tRatio;
Â*Â*Â*Â*Â*Â*Â* else
Â*Â*Â*Â*Â*Â*Â*Â *Â*Â*Â* commonConstrain tRatio = widthConstraint Ratio;
Â*Â*Â* }
Â*Â*Â* else if (widthConstrain tRatio &gt; 0 &amp;&amp; heightConstrain tRatio == 0)
Â*Â*Â*Â*Â*Â*Â* commonConstrain tRatio = widthConstraint Ratio;
Â*Â*Â* else if (widthConstrain tRatio == 0 &amp;&amp; heightConstrain tRatio &gt; 0)
Â*Â*Â*Â*Â*Â*Â* commonConstrain tRatio = heightConstrain tRatio;
Â*
Â*Â*Â* if (commonConstrai ntRatio &gt; 0)
Â*Â*Â* {
Â*Â*Â*Â*Â*Â*Â* printRectangle. Height = PicBox.Height * commonConstrain tRatio;
Â*Â*Â*Â*Â*Â*Â* printRectangle. Width = PicBox.Width * commonConstrain tRatio;
Â*Â*Â* }
Â*
Â*Â*Â* e.Graphics.Draw Image(PicBox.Im age, printRectangle) ;
Â*Â*Â* e.HasMorePages = false;Â*Â*Â*Â*Â *Â*Â*Â*Â*Â*Â*
}
Â*
private class PrinterBounds
{
Â*Â*Â* #region Legacy API
Â*Â*Â* [DllImport("gdi3 2.dll")]
Â*Â*Â* private static extern Int32 GetDeviceCaps(I ntPtr hdc, Int32 capindex);
Â*Â*Â* #endregion
Â*
Â*Â*Â* #region Constants
Â*Â*Â* private const int PHYSICALOFFSETX = 112;
Â*Â*Â* private const int PHYSICALOFFSETY = 113;
Â*Â*Â* private const int HORZRES = 8;
Â*Â*Â* private const int VERTRES = 10;
Â*Â*Â* #endregion
Â*
Â*Â*Â* #region Public Variables
Â*Â*Â* public readonly int HardMarginLeft;
Â*Â*Â* public readonly int HardMarginTop;
Â*Â*Â* public readonly int Width;
Â*Â*Â* public readonly int Height;Â*
Â*Â*Â* #endregion
Â*
Â*Â*Â* #region Constructor
Â*Â*Â* public PrinterBounds(P rintPageEventAr gs e)
Â*Â*Â* {
Â*Â*Â*Â*Â*Â*Â* IntPtr hDC = e.Graphics.GetH dc();
Â*
Â*Â*Â*Â*Â*Â*Â* HardMarginLeft = GetDeviceCaps(h DC, PHYSICALOFFSETX );
Â*Â*Â*Â*Â*Â*Â* HardMarginTop = GetDeviceCaps(h DC, PHYSICALOFFSETY );
Â*Â*Â*Â*Â*Â*Â* Width = GetDeviceCaps(h DC, HORZRES);
Â*Â*Â*Â*Â*Â*Â* Height = GetDeviceCaps(h DC, VERTRES);
Â*
Â*Â*Â*Â*Â*Â*Â* e.Graphics.Rele aseHdc(hDC);
Â*
Â*Â*Â*Â*Â*Â*Â* HardMarginLeft = (int)(HardMargi nLeft * 100.0 / e.Graphics.DpiX );
Â*Â*Â*Â*Â*Â*Â* HardMarginTop = (int)(HardMargi nTop * 100.0 / e.Graphics.DpiY );
Â*Â*Â*Â*Â*Â*Â* Width = (int)(Width * 100.0 / e.Graphics.DpiX );
Â*Â*Â*Â*Â*Â*Â* Height = (int)(Height * 100.0 / e.Graphics.DpiY );
Â*Â*Â* }
Â*Â*Â* #endregion
}

Jun 1 '07 #8
On Fri, 01 Jun 2007 16:28:40 -0700, Frank Rizzo <no**@none.comw rote:
First off, sorry for non-text mode of this post - the code looks like
crap that
way.
The code looks like crap which way? As text? I find plain text to be the
very *best* way to post code.
I figured the problem out with the help of an individual from MS Support.
Basically forget about all the values in e.PageBounds or
e.PageSettings. PrintableArea.
You have to drop down to the WinAPI to get what you need.
Forgive me my skepticism, but I believe MS Support is steering you wrong.
It's inconceivable to me that they would bother to include PrintableArea
as a property in the PageSettings when it's not a useful way to know where
on the page you can print.

I know all about the native Windows printing API methods to get the
information you seek (in fact, I know it much better than I know the .NET
stuff, since I've barely used the .NET stuff). But it really doesn't seem
to me that it should be necessary to go that route.

Anyway, I'm glad you got something that you feel addresses your problem in
the most appropriate way.

Pete
Jun 2 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2832
by: r6uji7 | last post by:
hello, is it possible to print certain details on a fixed area of a paper using PHP? here's the scenario: i'm trying to print labels with names and addresses. the names and addresses are stored in the database.
7
2494
by: Dennis C. Drumm | last post by:
I was wondering if someone could suggest were/how I could get started with setting up printing of a collection of text that includes tables from a grid and other supporting information about the grid's contents. If you could just point me at the classes that I should consider and some very broad guidelines that would be great. For instances, would a good approach be to build an rich text document somehow with the proper formatting and then...
1
2482
by: G.Esmeijer | last post by:
Friends, I'm (a bit) dissapointed about the printing possibilities in c#. It could also be lack of knowedge. I would like to align a text on the right side of the paper when printing. For example tekst = DateTime.Today.Date.ToString("dd-MM-yyyy"); // asign content to the variable tekst
2
2194
by: Tim | last post by:
Hi, I have created some code for printing a column report. The default page size is 850 x 1100, which is correct. The print preview looks perfect. The data is positioned exactly where it should be. (centered) When I go to print however, the data is shifted to the right. About a margin's worth. I set the margins at 50 and it looks like it is at 100. I checked the code and the starting X position is at 50. So why is it
1
1824
by: mivey4 | last post by:
I have a project for which I need to print the contents of a richtext box to the printer. In VB6 this was a very simplified task but in VB.NET it seems to be noted as a more complicated technique. I have been programming for a short while but my strategy for learning new tasks is to view the most simplified version of code available. This way I can easily see the logic and proceed to complicate things based upon my own learning however I...
7
2746
by: tm | last post by:
I am trying to print a form using the following code, everything works fine but the margins are not acted upon. What I am I doing wrong? Private Sub CaptureScreen() Dim myGraphics As Graphics = Me.CreateGraphics() Dim s As Size = Me.Size memoryImage = New Bitmap(s.Width, s.Height, myGraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage)
1
1600
by: Marc | last post by:
Hi, I am setting up a orint function that prints the screen area. It is all working except my screen area spans two print pages hwne viewed using a print preview dialogue . I am trying to fnd a way to make the print area fit onto a standard A4 paper print area. Anyone any idea how I can control this and 'shrink' my current print document?
2
9972
by: Brad Pears | last post by:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default printer settings to print. I wanted the print preview to appear the same for all users (i.e. a default page size of 8.5x14 (legal) and portrait mode). Many users have different printers as their default (plotters etc..) and I found that various...
0
1552
by: dekepler | last post by:
Hello all, I've written and used other's python scripts (You've probably seen it) to print a bunch of photos in *.jpg format and seem to be having an Memory Error problem. After the first image is printed the script loads the next and I get the Memory Error. Each .jpg is between 40 and 75 mb. This script work with smaller (5 to 10mb) .jpg's. Here's the script. If you have suggestions for better image handling, I'm all ears. Thanks. import...
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.