how to print barcode with high quality [duplicate] - c#

This question already has answers here:
printing quality winform
(4 answers)
Print a Form at higher dpi than screen resolution
(2 answers)
Printing Windows Form
(4 answers)
Closed 5 years ago.
I am creating an image of a ticket with System.Drawing.Graphics in WinForm C#.
The image contains a text which I generate with Graphics.DrawString, A logo that I load with Graphics.DrawImage, And a barcode that I manually draw with Graphics.DrawLine.
The generated image looks great digitally but the problem is that at the moment of printing the image looks great except the barcode, that is printed with poor quality, I had already tried many libraries to generate bar codes, but the bar code continues to print with poor quality, so I choose to draw it manually, but regardless of my effort, it still looks with low resolution.
If someone knows any configuration to generated and printed my barcode with high resolution I would appreciate it very much for your help

Related

Blurry/odd text in winforms - cleartype/scaling issue? [duplicate]

This question already has answers here:
How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?
(6 answers)
Closed 5 years ago.
I developed an winforms program on w8 and just tried it on w10 for the first time, the following image shows how the text looks in the forms editor of vs2015 versus how it looks when the program is executed.
https://ibb.co/hhi40v
The text in the title bar renders fine.
I should probably mention I'm at 4k resolution with 150% scaling - I tried all the autoscalemode options and none did the job.
There seem to be ways to deal with this in wpf but in winforms I can't find any information, which is odd because this is presumably a common thing.
This is known issue - you need to develop your WinForms app to be a DPI-aware.
Read here for example and detailed explanation: Creating a DPI-Aware Application
Generally, you need to apply a specific Forms design rules to make them DPI-independent.

How would I go about drawing a rectangular selection on-screen when the mouse is dragged and then getting a screenshot of the selected area? [duplicate]

This question already has answers here:
.NET Equivalent of Snipping Tool
(3 answers)
Closed 5 years ago.
I'm looking for a way to draw a rectangular selection-visualiser, basically similar to Gyazo.
If any of you are familiar with iOS jailbreaking and have used Snapper 2 before, I'm trying to do that but for Windows. For those of you who aren't, it allows you to select an area you want for a screenshot and then keeps it on top of everything else, allowing you to drag it around, save it etc. It's really useful for phone numbers, WiFi passwords among other things.
The only issue is that I don't know how I'd go about drawing a selection area and grabbing an image of it.
Any help would be appreciated.
Windows since 7 has the Snipping tool. It might be close enough to the droid you are looking for: https://support.microsoft.com/en-us/help/13776/windows-use-snipping-tool-to-capture-screenshots
If you mean .NET with C#, there is Graphics.CopyFromScreen. Note that it does not work from Windows services - a interactive session is required and Services are barred from those by default since Vista.
One issues is having this thing be drawn "on top". Generally the topmost game is one you and the user can only loose. Everything that is able to win it is either part of Windows itself. Or uses a "intercept GPU output, draw something on top" approach, wich is not trivial.

How to get the actual desktop screen resolution in wpf? [duplicate]

This question already has answers here:
How to get the size of the current screen in WPF?
(16 answers)
Closed 6 years ago.
I am developing a kinect application using WPF. Now I need to get the actual desktop screen resolution so that I can scale the area to take screenshot for any laptops. I have tried PrimaryScreenWidth, PrimaryScreenHeight, FullScreenHeight, and all that, but none of them give me the ACTUAL resolution. For example, if I have 1920*1080, those above fields will give me some other values.
I was wondering how to get the actual desktop screen resolution from C# WPF?
Just use this:
System.Windows.SystemParameters.PrimaryScreenWidth
System.Windows.SystemParameters.PrimaryScreenHeight
or this:
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height

Best way to accomplish this: Imaging? [duplicate]

This question already has answers here:
Load a WPF BitmapImage from a System.Drawing.Bitmap
(10 answers)
Get ImageSource from Bitmap?
(1 answer)
Closed 9 years ago.
I am reading ID tags for music files in my program. I am using Taglib sharp for this.
But what I have troubles with is when I'm reading the album-art tag.
I get the album art image just fine. But it's in System.Drawing instead of WPF's System.Windows.Media.Imaging.BitmapImage. And from what I've seen; the "Image" control inside of WPF can't use system.drawing images as a source?
What I've been doing is to save a local image every time I select a new song, and loading Imagebox.Source with a bitmapimage URI of that local image. And I'm actually smart enough to understand that it isn't such a smart solution of the problem.
But how would I set the image without saving it to a file and then opening it again?
Like if there's a similar feature to winforms picturebox.image in WPF?
I hope you all understand what I'm trying to tell you guys.
Thanks in advance.
I have an open source library called TagDotNet that might be useful to you.
SourceForge Page

How to resize animated gif file using C#? [duplicate]

This question already has answers here:
How to resize an animated gif image using C#?
(3 answers)
Closed 9 years ago.
Dear all,
I need to re-size an animated gif file on my provided size, using C#.How can i do that.I search the solution on the google but don't get any proper solution.I already see the atalasoft,codeproject,giflib on codeplex but non of this is proper solution.So, Please help me just re-size an animated gif file using c#.
thanks in advance
Riad
Actually, no quick-and-dirty method exists.
You will need to split the GIF into separate frames, then re-size each individual frame, then re-assemble the GIF image.
And sorry, I do not have the code to provide you, other than to refer you to Google
Atalasoft's DotImage should be fine, and they even have sample code on their site.

Categories