Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8458149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:00:01+00:00 2026-06-10T13:00:01+00:00

using (var mem = new MemoryStream()) using (var bmp = new Bitmap(85, 54)) using

  • 0
using (var mem = new MemoryStream())
using (var bmp = new Bitmap(85, 54))
using (var gfx = Graphics.FromImage((Image)bmp))
{
    // gfx.SmoothingMode = SmoothingMode.AntiAlias;
    gfx.PageUnit = GraphicsUnit.Millimeter;
    gfx.FillRectangle(Brushes.Red, new Rectangle(0, 0, bmp.Width, bmp.Height));

    //add question
    gfx.DrawString(captcha, new Font("Arial", 5), Brushes.Blue, bmp.Width / 2, bmp.Height/2);

    //render as Jpeg
    bmp.Save(mem, System.Drawing.Imaging.ImageFormat.Jpeg);
    img = this.File(mem.GetBuffer(), "image/Jpeg");
}

return img;

this not work.
I need 85×54 millimeter

how do this?

I need draw for print

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:00:03+00:00Added an answer on June 10, 2026 at 1:00 pm

    The size of this Bitmap is in pixels.

    When you display a bitmap on a regular display a single pixel will be 1/96th of an inch. Other displays might have other DPI’s (Dots Per Inch) – such as Retina displays

    Most printers support at least 300 DPI.

    So what you need to do is get the DPI of the screen or printer and size the bitmap accordingly or use a image format (vector?) that allows you to specify the DPI. Some bitmap formats also allow you to specify the intended DPI

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: public byte[] SerializeToBlob() { using (var buffer = new MemoryStream())
Consider the following code: using (var ms = new MemoryStream()) { using(var writer =
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
using (var client = new WebClient()) { html = client.DownloadString(some_string); //do something html =
using (var openFileDialog1 = new OpenFileDialog()) { openFileDialog1.Reset(); if (!string.IsNullOrEmpty(ExcelFilePath)) { string fileName =
using (var dataContext = new realtydbEntities()) { var user = ( from aspnet_Roles rol
I am using var bitmapdata:BitmapData=new BitmapData(); var pixels:Bytearray=new Bytearray(); pixels = rleDecodePixles(); bitmapdata.setPixels(bitmapdata.rect, pixels);
class OneAtATimePlease { static void Main() { using (var mutex = new Mutex(false, oreilly.com
I'm using var abc = new { id = 0 }; in my C#
I have the following code: using (var db = new IntDB()) { var subscription

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.