Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Shaun Becker

@Shaun Becker
About
Posts
38
Topics
21
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Tape Drive access
    S Shaun Becker

    Is it possible to read, write, and perform drive maintenance(cleaning, inventory, etc.) on a tape drive from C#? Thanks alot

    C# csharp question

  • Access files in use
    S Shaun Becker

    Is there a way to access files that are currently in use by another program? I am sure that there is because backup utilities do it all the time, but I just have no idea how to do it. I would really appreciate any help. Thanks

    C# help tutorial question

  • .Net Bitmap to DIB
    S Shaun Becker

    Does anyone know how to convert a .NET bitmap to a DIB? I have tried to port code from C++ without success, so I would appreciate any help. Thanks alot

    C# csharp c++ graphics help tutorial

  • Print .Net Bitmap with Win32 API
    S Shaun Becker

    Why are you posting as Anonymous, you don't want anybody to know who you are?

    C# csharp graphics json question

  • Print .Net Bitmap with Win32 API
    S Shaun Becker

    That wouldn't work because I only have a certain block of time that the reports can print because the printer is used for other purposes and with the .Net printing framework, it is constantly going behond that block. It is not the report generation that is slowing down the process, it is the actual printing of the reports. And actually, I am almost done with the Win32 Api printing functions and it seems to be considerably faster.

    C# csharp graphics json question

  • Print .Net Bitmap with Win32 API
    S Shaun Becker

    The reason that I want to use API is because I am working on a project to print invoices. The .Net printing framework is to slow to keep up with the volume of invoices printed every night. So, my only other alternative is to print using the API. Thanks for your help.

    C# csharp graphics json question

  • Print .Net Bitmap with Win32 API
    S Shaun Becker

    Does anybody know how I could print a .Net Bitmap with Win32 Api calls? Thanks alot

    C# csharp graphics json question

  • Printing a blank page
    S Shaun Becker

    Do you know of a good resource on printing with Win32 Api? Everything that I have found has been very vague and not as detailed as I would like. Thanks alot. I really appreciate your help.

    C# json question

  • Printing a blank page
    S Shaun Becker

    The reason that I am trying to use Win32 to print instead of the .Net framework is because the project I am working on is a mass printing system and the .Net framework is too slow to keep up. How do I change the text color? Thanks

    C# json question

  • Printing a blank page
    S Shaun Becker

    Here is the code. Thanks alot public IntPtr CreateFont(IntPtr hDC, string fontName, int size, FontStyle style) { LOGFONT lf = new PrinterApi.LOGFONT(); FONT_WEIGHT_FLAGS weight = FONT_WEIGHT_FLAGS.FW_DONTCARE; if (Convert.ToBoolean(style & FontStyle.Bold)) { weight |= FONT_WEIGHT_FLAGS.FW_BOLD; } if (Convert.ToBoolean(style & FontStyle.Regular)) { weight |= FONT_WEIGHT_FLAGS.FW_REGULAR; } lf.lfHeight = (-1) * GetFontSize(hDC, size); lf.lfWidth = 0; lf.lfEscapement = 0; lf.lfOrientation = 0; lf.lfWeight = weight; lf.lfItalic = Convert.ToByte(style & FontStyle.Italic); lf.lfUnderline = Convert.ToByte(style & FontStyle.Underline); lf.lfStrikeout = Convert.ToByte(style & FontStyle.Strikeout); lf.lfOutPrecision = CHARACTER_PRECISION.OUT_TT_ONLY_PRECIS; lf.lfClipPrecision = CLIP_PRECISION.CLIP_DEFAULT_PRECIS; lf.lfPitchAndFamily = (byte)FONT_PITCH.DEFAULT_PITCH | (byte)FONT_FAMILY.FF_DONTCARE; lf.lfFaceName = new byte[LF_FACESIZE]; byte[] temp = Encoding.ASCII.GetBytes(fontName); for (int i = 0; i < lf.lfFaceName.Length; i++) { if (i >= temp.Length) { lf.lfFaceName[i] = 0; } else { lf.lfFaceName[i] = temp[i]; } } return CreateFontIndirect(ref lf); } int GetFontSize(IntPtr hDC, int size) { return size / 72 * GetDeviceCaps(hDC, LOGPIXELSY); } public void Method() { string Text = "Some Text"; IntPtr hDC = CreateDC(null, @"Network Imagistics im3510 PCL5e", null, 0); DOCINFO doc = new PrinterApi.DOCINFO(); doc.cbSize = Marshal.SizeOf(typeof(DOCINFO)); doc.lpszDocName = "Test Win32Printer"; doc.lpszOutput = null; if (StartDoc(hDC, doc)) { StartPage(hDC); try { RECT rectStruct = new PrinterApi.RECT(); rectStruct.Left = 0; rectStruct.Top = 0; rectStruct.Right = 600; rectStruct.Bottom = 600; IntPtr font = CreateFont(hDC, "Times New Roman", 20, 0); IntPtr oldFont = SelectObject(hDC, font); DrawText(hDC, Text, Text.Length, ref rectStruct, DRAWTEXT_FORMAT_FLAGS.DT_NOCLIP); SelectObject(hDC, oldFont); DeleteObject(font); EndPage(hDC); EndDoc(hDC); } catch (Exception e) { AbortDoc(hDC); throw e; } finally { } } DeleteDC(hDC); }

    C# json question

  • Printing a blank page
    S Shaun Becker

    I am trying to print formatted text with the Win32 Api using the DrawText function and it is printing out a blank page. Does anybody know what I could be doing wrong? Thanks

    C# json question

  • Printing With Win32API
    S Shaun Becker

    I am doing an application to print my companies invoices. Currently it uses the .net printing framework. I am looking to change that to straight Win32API to help speed it up. Plus that will use less resources. Three questions. 1) I can't seem to create a font with CreateFontIndirect(LOGFONT). I think that I am putting in the wrong value for the height. Could someone give me an example of how to create a font with that API? 2) I can't seem to use the DrawText function. I can print using the TextOut but I wanted to use the DrawText function for the formatting options. However, whenever I try to use it, it prints out a blank page. Could someone give me an example of how to print text with that API? 3) Does anyone know of a good resource to printing with pure Win32API? Thanks alot for any help. Shaun

    C# tutorial csharp css json performance

  • Looking for a project
    S Shaun Becker

    I am looking for a project to do be a part of. I don't really care what kind of project although I would prefer to use dotnet. I live in the detroit,mi area. I have been programming for about 3 years. I know c#, vb.net, vb, sql, access, and a little c\c++, asp, asp.net, and html. My work experience is primarily with client/server apps. Is anybody recruiting or does anybody know where I could look? Thanks alot

    The Lounge csharp c++ html asp-net

  • Form using too much memory
    S Shaun Becker

    I am using 1.0 under Windows 2000 professional. However, that arises another question, how do I change VS.NET 2002 to use 1.1 instead of 1.0?

    C# performance question

  • Form using too much memory
    S Shaun Becker

    In an application I am working on, I have a form that on startup, loads my addin structure and some other useful static classes. When I watch Task Manager during the form's startup, it starts up using 13500K of memory. If I minimize the form, it shoots down to 300K. Then when I restore it, it goes to only 1000K. If I start the form minimized, it still starts up taking 13500K. Then when I restore it, if jumps up 13600K. Then when I minimize it again, it drops back to 300K and up to 1000K when I restore it. Is there a way to avoid this form using so much memory on startup without having to minimize it and restore it? Thanks

    C# performance question

  • Print .Net Bitmap With MFC
    S Shaun Becker

    Is there a way to print a .net bitmap with mfc? Thanks

    C / C++ / MFC csharp c++ graphics question

  • Print .Net Bitmap With MFC
    S Shaun Becker

    Is there a way to print a .net bitmap with mfc? Thanks

    Managed C++/CLI csharp c++ graphics question

  • Render HTML
    S Shaun Becker

    Is there a way to render html without using the SHDocVw control? The reason that I don't want to use that control is because I don't want the overhead of the control having internet access. I also want the control to be able to render dynamic html while the SHDocVw control seems to only render static web pages. I would really appreciate some advice or even just a point in the right direction. Thanks

    C# html question

  • Increase Printing Speed
    S Shaun Becker

    But can anybody explain why it takes longer to print a 159KB gif image than it does to print a 1344KB tiff image?

    C# question performance code-review

  • Increase Printing Speed
    S Shaun Becker

    I developed a system to print our companies invoices. Now, I am trying to find ways to optimize the system. One of the biggest things is how long it takes to print. When a bill is printed, it also prints all the paperwork stored as tiff images that go with that bill. These images really seem to take a long time to print. I tried converting them to a smaller format to hopefully speed up spooling time. Funny enough, it took longer to print a 159KB gif file than a 1344KB tiff file. My question is, does anybody know of a way to decrease the amount of time it takes to print these images? Thanks.

    C# question performance code-review
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups