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
C

cmarmr

@cmarmr
About
Posts
98
Topics
65
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • save a jpg as 8 bit grayscal
    C cmarmr

    here is a code snip i am using but when i save a jpg with this code it is 24 bit grayscale saveJpeg(file1,img,8); private void saveJpeg(string path, Bitmap img, long quality) { // Encoder parameter for image quality EncoderParameter qualityParam = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, quality); // Jpeg image codec ImageCodecInfo jpegCodec = this.getEncoderInfo("image/jpeg"); if (jpegCodec == null) return; EncoderParameters encoderParams = new EncoderParameters(1); encoderParams.Param[0] = qualityParam; img.Save(path, jpegCodec, encoderParams); } private ImageCodecInfo getEncoderInfo(string mimeType) { // Get image codecs for all image formats ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders(); // Find the correct image codec for (int i = 0; i < codecs.Length; i++) if (codecs[i].MimeType == mimeType) return codecs[i]; return null; }

    Thanks, Chad Aiena

    C# graphics

  • setting printer options
    C cmarmr

    how do i set printer options? i would like to set these options print from tray 1 pagesize 11x17 landscape this is the code i am using System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument(); pd.PrinterSettings = printDialog1.PrinterSettings; pd.PrinterSettings.Duplex = System.Drawing.Printing.Duplex.Simplex; pd.DocumentName = "JP Council (Title Page)"; pd.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.pd_PrintPage); pd.Print(); i know it has to be something with the printersettings but just now sure how to do it

    Thanks, Chad Aiena

    C# question graphics tutorial

  • convert image format [modified]
    C cmarmr

    i get an error saying invalid parameter on the save line

    Thanks, Chad Aiena

    C# question graphics

  • convert image format [modified]
    C cmarmr

    can somebody please tell me what is wrong with the code below i am trying to conver some single page tif's images to group 4 compression the original format was LZW string dir = args.Length>1 ? args[0]: System.IO.Directory.GetCurrentDirectory(); dir = @"C:\Documents and Settings\caiena\Desktop\mail out DEQ\form"; string outdir= args.Length>2 ? args[1] : dir+"\\processed"; if(!System.IO.Directory.Exists(outdir)) System.IO.Directory.CreateDirectory(outdir); string[] files = System.IO.Directory.GetFiles(dir, "*.tif"); System.Console.WriteLine("input dir {0}", dir); System.Console.WriteLine("Processed dir {0}", outdir); System.Drawing.Imaging.Encoder enc = System.Drawing.Imaging.Encoder.Compression; EncoderParameters ep = new EncoderParameters(1); ImageCodecInfo info = GetEncoderInfo("image/tiff"); ep.Param[0] = new EncoderParameter(enc, (long) System.Drawing.Imaging.EncoderValue.CompressionCCITT4); foreach (string file in files) { System.IO.FileInfo fi = new System.IO.FileInfo(file); using (System.Drawing.Image img = System.Drawing.Image.FromFile(fi.FullName)) { System.Console.WriteLine("converting file {0}", outdir + fi.Name); img.Save(outdir+ fi.Name, info, ep); } } -- modified at 16:53 Monday 8th October, 2007

    Thanks, Chad Aiena

    C# question graphics

  • duplex images on a printer
    C cmarmr

    i have 100 tif images that i need to send to the printer to be duplexed i have never done this before and i don't know where to begin can somebody help me? (i need them duplexed Long)

    Thanks, Chad Aiena

    C# help question

  • add reference to a .exe
    C cmarmr

    the dll is a csharp dll i want to implment a menu that i can add calls to a dll at a later time for examlpl i would have a job that downloads files from a ftp site and uses the files to update a back end database and i could also have another job that downloads some zip file for a user to process at a latter time. and i was thinking it would be easier if i just had one menu that i could add ref. to different dll's to handel the custom job's i want to setup rather than recompiling the menu each time

    Thanks, Chad Aiena

    C# xml tutorial

  • add reference to a .exe
    C cmarmr

    i have a program that i want to be able to dynamicaly add ref to dll that i build at a latter date. my plan is to store these ref. is an xml file and when i run my program read the xml file and add the ref to the dll's. but i am unsure how to add dll ref to a already compailed program

    Thanks, Chad Aiena

    C# xml tutorial

  • split a jpg into 2 frame
    C cmarmr

    thanks, minor oversight

    Thanks, Chad Aiena

    C# graphics help

  • split a jpg into 2 frame
    C cmarmr

    i am trying to split a jpg right down the center and the left fram splits ok but the right frame has the problem it is 2 time as big as it need to be and it has a huge black border to the right can somebody please help me here is my code public void split(System.Drawing.Image oimage) { System.Drawing.Bitmap bmp = new Bitmap(oimage.Width/2, oimage.Height); bmp.SetResolution(oimage.HorizontalResolution,oimage.VerticalResolution); System.Drawing.Rectangle lrec = new System.Drawing.Rectangle(0, 0,oimage.Width/2,oimage.Height); System.Drawing.Rectangle rrec = new System.Drawing.Rectangle(oimage.Width/2,0 ,oimage.Width/2, oimage.Height); System.Drawing.Image[] frames = new Image[2]; frames[0] =(Image) bmp; bmp = new Bitmap(oimage.Width, oimage.Height); bmp.SetResolution(oimage.HorizontalResolution, oimage.VerticalResolution); frames[1] =(Image) bmp; System.Drawing.Graphics gr = System.Drawing.Graphics.FromImage(frames[0]); gr.DrawImage(oimage, new Rectangle(0, 0,oimage.Width/2, oimage.Height),lrec, GraphicsUnit.Pixel); frames[0].Save(@"c:\temp\frameLeft.jpg", System.Drawing.Imaging.ImageFormat.Jpeg); gr = System.Drawing.Graphics.FromImage(frames[1]); gr.DrawImage(oimage,new Rectangle(0, 0, oimage.Width/2, oimage.Height),rrec, GraphicsUnit.Pixel); frames[1].Save(@"c:\temp\frameRight.jpg", System.Drawing.Imaging.ImageFormat.Jpeg); }

    Thanks, Chad Aiena

    C# graphics help

  • call a vb function with out paramaters
    C cmarmr

    yes and it did not work

    Thanks, Chad Aiena

    C# csharp help question

  • call a vb function with out paramaters
    C cmarmr

    i am using csharp and i am calling a dll that was written in vb 6 and one of its methods i call has a optional parameter how do i call this function without a parameter without throwing a compiler error

    Thanks, Chad Aiena

    C# csharp help question

  • dll
    C cmarmr

    can you give me a quick code snip of how i would put it in the dll (sorry i am still learning csharp) or something like this but how to i show it using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; namespace dllform { public class Class1 { Form test = new Form() } }

    Thanks, Chad Aiena

    C# csharp com design question

  • dll
    C cmarmr

    i have a vb 6 activex dll and i am able to run a form inside of the dll is it possible to do the same thing in csharp ( run a form from a dll) or is there no UI in csharps DLLs?

    Thanks, Chad Aiena

    C# csharp com design question

  • ajax and img
    C cmarmr

    can somebody help me out i trying to figure out how i can use ajax to load a new img without a postback

    Thanks, Chad Aiena

    ASP.NET help

  • twain or isis
    C cmarmr

    does anyone know how to use a scanner with a adf using twain or isis? i also woundering if i could scan using my software not the software that came with the scanner because right now when i use twain from my program it opens the software that came with the scanner to control the scanning process i want to be able to do that with my program Thanks, Chad Aiena

    C# tutorial question

  • dynamicly add asp controls to a web page
    C cmarmr

    i want to add a button to my webpage at runtime, and i want it to postback and use a server procedure i setup for it my codebehind is a csharp file can somebody help me with this. Thanks, chad Aiena

    Web Development csharp sysadmin help workspace

  • stop postback in asp.net
    C cmarmr

    i returned false and a postback stilled happeded i have server side code on this asp.net button which writes "server" in that textbox and i want to be able to stop that from happening thanks chad

    Web Development csharp javascript html asp-net sysadmin

  • stop postback in asp.net
    C cmarmr

    how do i use my javascript to stop postback in the input is not correct i don't want it to post back to the server here is the code: private void Page_Load(object sender, System.EventArgs e) { // Form the script that is to be registered at client side. String scriptString = " \n"; scriptString += "function DoClick()\n {\n"; scriptString += "\t myForm.show.value='Welcome to Microsoft .NET'; \n "; scriptString += "return true;\n}"; scriptString += ""; if(!this.IsClientScriptBlockRegistered("clientScript")) this.RegisterClientScriptBlock("clientScript", scriptString); button.Attributes["onclick"]="DoClick()"; } here is the html:

    Thanks chad -- modified at 22:40 Monday 27th February, 2006

    Web Development csharp javascript html asp-net sysadmin

  • asp default button
    C cmarmr

    how do i make a default button in asp (not asp.net) i want when somebody hits enter on my web page it presses my submit button chad

    Web Development csharp asp-net question

  • asp pages
    C cmarmr

    ok i have a existing asp page that was created by another programmer and i pulled it in visual studio and i put a button and a textbox on the page visualy and the page looks right when i view it in visual studio but all my objects are all over the place when i go the the web site can somebody help me with this chad

    Web Development csharp visual-studio help
  • Login

  • Don't have an account? Register

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