473,595 Members | 2,576 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 8978
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
2831
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
2481
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
2475
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
2192
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
2744
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
1596
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
9951
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
1523
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
7955
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
7883
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
8261
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
8251
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
5839
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
3911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2391
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1490
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.