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
L

Le rner

@Le rner
About
Posts
1.6k
Topics
714
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to get image Thumbnail without open it?
    L Le rner

    FileStream fs = new System.IO.FileStream(img_path, FileMode.Open, FileAccess.Read);
    img = Image.FromStream(fs);

    Image imgThumb = img.GetThumbnailImage(thumbnailSize.Width, thumbnailSize.Height, null, IntPtr.Zero);
    //imgThumb use it for thumbnail

    fs.Close();
    fs.Dispose();

    img.Dispose();

    i use this for getting thumbnail, but it takes time if file is large,or i take tumbnail of multiple big size images.... that's why i ask its possible to get image thumbnail without using the image file. is this possible with the use of "IExtractImage"

    C# tutorial question

  • how to get image Thumbnail without open it?
    L Le rner

    hi all, is there any option to get image file thumbnail ,but without open the image file. please guide me for this. thanks in advance.

    C# tutorial question

  • how set cutom paper size?
    L Le rner

    i am create a PDF file using Microsoft Print to PDF,

    PaperSize paperSize = new PaperSize("Custom", 400, 200);

    PrintDocument pd = new PrintDocument();

                pd.PrinterSettings.PrinterName = "Microsoft Print to PDF";
                pd.PrinterSettings.PrintToFile = true;
                pd.PrinterSettings.PrintFileName = PDF\_File\_name;
    
                pd.DefaultPageSettings = Default\_PrintProfile\_PDF;
                pd.PrinterSettings.DefaultPageSettings.PaperSize = paperSize;
    
                pd.DefaultPageSettings.PaperSize = paperSize;
    
                pd.PrintController = new StandardPrintController();
    
                pd.PrintPage += PrintPage\_As\_PDF;
    
                pd.Print();
    

    but custom size not set, printable area is eqal to letter paper size. please help me for this.

    C# help question

  • change exe icon not work with multiple stage icon file.
    L Le rner

    hi all, i am change my exe icon its working fine with icon which have single stage icon. but if i select a icon file that have multiple size stages in icon file, icon not reflect on exe.

    HANDLE handle = BeginUpdateResource(exe_file, FALSE);

    char *buffer; // buffer to store raw icon data
    long buffersize; // length of buffer
    int hFile; // file handle

    hFile = open(ico_file, O_RDONLY | O_BINARY);
    if (hFile == -1)
    return; // if file doesn't exist, can't be opened etc.

    // calculate buffer length and load file into buffer
    buffersize = filelength(hFile);
    buffer = (char *)malloc(buffersize);
    read(hFile, buffer, buffersize);
    close(hFile);

    int icon_id=1;

     UpdateResource(
      handle,  // Handle to executable
      RT\_ICON, // Resource type - icon
      MAKEINTRESOURCE(icon\_id), // Make the id 1
      
      MAKELANGID(LANG\_NEUTRAL, SUBLANG\_NEUTRAL),
    
      (buffer+22), 
      // skip the first 22 bytes because this is the 
      // icon header&directory entry (if the file 
      // contains multiple images the directory entries
      // will be larger than 22 bytes
      buffersize-22  // length of buffer
     );
    
    
    
    /////////////////////
    

    // Again, we use this structure for educational purposes.
    // The icon header and directory entries can be read from
    // the file.
    GROUPICON grData;

    icon_id=1;

    // This is the header
    grData.Reserved1 = 0; // reserved, must be 0
    grData.ResourceType = 1; // type is 1 for icons
    grData.ImageCount = 1; // number of icons in structure (1)

    // This is the directory entry
    grData.Width = 32; // icon width (32)
    grData.Height = 32; // icon height (32)

    grData.Colors = 0; // colors (256)
    grData.Reserved2 = 0; // reserved, must be 0
    grData.Planes = 2; // color planes
    grData.BitsPerPixel = 32; // bit depth

    grData.ImageSize = buffersize - 22; // size of image

    grData.ResourceID = icon_id; // resource ID is 1

    UpdateResource(
    handle,
    RT_GROUP_ICON,

      MAKEINTRESOURCE(icon\_id),
      // MAINICON contains information about the
      // application's displayed icon
      
      MAKELANGID(LANG\_NEUTRAL, SUBLANG\_NEUTRAL),
    
      &grData,
      // Pointer to this structure
      sizeof(GROUPICON)
     );
    

    delete buffer; // free memory

    // Perform the update, don't discard changes
    // Write changes then close it.
    if (!EndUpdateReso

    C / C++ / MFC performance announcement learning

  • how i convert my x86 project in x64
    L Le rner

    ok thank you to guide me in right direction

    C / C++ / MFC help workspace

  • how i convert my x86 project in x64
    L Le rner

    please can anybody explain me how i convert my x86 project in x64 when i change it in configuration manager and set to x64 it gives error like Error 1 error C2371: 'ULONG' : redefinition; different basic types C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\intsafe.h 65 1 Rec_Pen_drive plz help for this

    C / C++ / MFC help workspace

  • My winform resize when i open an OleDbConnection
    L Le rner

    i am using OleDbConnection to read excel files. excel file is read properly. but my form is resize and all text looks bigger and buggy when i open the connection. i really dont understand whats happend. please help me for this. thanks in advance.

    DataTable sheet1 = new DataTable("Excel Sheet");
    OleDbConnectionStringBuilder csbuilder = new OleDbConnectionStringBuilder();
    csbuilder.Provider = "Microsoft.ACE.OLEDB.12.0";
    csbuilder.DataSource = filename;
    csbuilder.Add("Extended Properties", "Excel 12.0 Xml;HDR=YES");
    string selectSql = @"SELECT * FROM [Sheet1$]";

                using (OleDbConnection connection = new OleDbConnection(csbuilder.ConnectionString))
    
    
                using (OleDbDataAdapter adapter = new OleDbDataAdapter(selectSql, connection))
                {
                    
                    connection.Open();
                    adapter.Fill(sheet1);
    
                    connection.Close();
    
                    
                }
    
    C# xml help

  • how draw border on round image png?
    L Le rner

    Bitmap bmp = new Bitmap(@"C:\Users\Ali\Desktop\1.png");
    int w = bmp.Width;
    int h = bmp.Height;
    Lst_Data lastpointcolor = new Lst_Data() ;
    for (int y = 0; y < h; y++)
    {
    for (int x = 0; x < w; x++)
    {
    Color c = bmp.GetPixel(x, y);
    if (c.A != Color.Transparent.A)
    {
    if (lastpointcolor.color.A == Color.Transparent.A)
    {
    bmp.SetPixel(lastpointcolor.point.X, lastpointcolor.point.Y, Color.Red);
    }
    }
    lastpointcolor = new Lst_Data() { point = new Point(x, y), color = bmp.GetPixel(x, y) };
    }
    }

            for (int y = h-1; y > 0; y--)
            {
                for (int x = w-1; x > 0; x--)
                {
                    Color c = bmp.GetPixel(x, y);
                    if (c.A != Color.Transparent.A)
                    {
                        if (lastpointcolor.color.A == Color.Transparent.A)
                        {
                            bmp.SetPixel(lastpointcolor.point.X, lastpointcolor.point.Y, Color.Red);
                        }
                    }
                    lastpointcolor = new Lst\_Data() { point = new Point(x, y), color = bmp.GetPixel(x, y) };
                }
            }
            pictureBox1.Image = bmp;
        }
    

    public struct Lst_Data
    {
    public Point point;
    public Color color;
    }

    can anybody help to draw more thick border around the image

    C# graphics help question

  • how draw border on round image png?
    L Le rner

    winform i m taking help from this article https://stackoverflow.com/questions/15858002/drawing-a-border-on-an-image[^] i also want to set different width of border.

    C# graphics help question

  • how draw border on round image png?
    L Le rner

    hi all, can anybody help me to draw a thick border around round png.

    Bitmap bmp = new Bitmap(@"C:\Users\Ali\Desktop\1.png");
    int w = bmp.Width;
    int h = bmp.Height;
    Lst_Data lastpointcolor = new Lst_Data() ;
    for (int y = 0; y < h; y++)
    {
    for (int x = 0; x < w; x++)
    {
    Color c = bmp.GetPixel(x, y);
    if (c.A != Color.Transparent.A)
    {
    if (lastpointcolor.color.A == Color.Transparent.A)
    {
    bmp.SetPixel(lastpointcolor.point.X, lastpointcolor.point.Y, Color.Red);
    }
    }
    lastpointcolor = new Lst_Data() { point = new Point(x, y), color = bmp.GetPixel(x, y) };
    }
    }

            for (int y = h-1; y > 0; y--)
            {
                for (int x = w-1; x > 0; x--)
                {
                    Color c = bmp.GetPixel(x, y);
                    if (c.A != Color.Transparent.A)
                    {
                        if (lastpointcolor.color.A == Color.Transparent.A)
                        {
                            bmp.SetPixel(lastpointcolor.point.X, lastpointcolor.point.Y, Color.Red);
                        }
                    }
                    lastpointcolor = new Lst\_Data() { point = new Point(x, y), color = bmp.GetPixel(x, y) };
                }
            }
            pictureBox1.Image = bmp;
        }
    

    public struct Lst_Data
    {
    public Point point;
    public Color color;
    }

    thanks in advance.

    C# graphics help question

  • how to save Image or Bitmap to svg file
    L Le rner

    can anybody guide me

    how to save Image or Bitmap to svg file

    thanks

    C# tutorial graphics

  • IVideoWindow.SetWindowPosition not working
    L Le rner

    hi all i am using directshow lib to capture web cam in my application all is gud capture image is ok but the webcam video screen not display properly i pass icture control handle of form to diaply webcam on my form

    Rectangle rc = hControl.ClientRectangle;

    ivw.SetWindowPosition(rc.X, rc.Y, rc.Width , rc.Height);

    please help me for this. thank

    C# help

  • Mixed mode assembly is built against version 'v2.0.50727'
    L Le rner

    yes thanks for all help

    C# help announcement workspace

  • Mixed mode assembly is built against version 'v2.0.50727'
    L Le rner

    i already use it, and mentioned it above

    C# help announcement workspace

  • Mixed mode assembly is built against version 'v2.0.50727'
    L Le rner

    hi all, i got this error Mixed mode assembly is built against version 'v2.0.50727' of runtime and cannot be loaded in the 4.0 runtime without additional configuration. i changed my app.config file but still this occur.

    please help for this.

    C# help announcement workspace

  • how sort datgridview or listview like windows explorer
    L Le rner

    for string its working fine, now what about date time, how i compare here date time of file, to sort according this

    C# help

  • how get dpi scale factor
    L Le rner

    yes i want this scaling factor in c#

    C#

  • how get dpi scale factor
    L Le rner

    ok sorry

    C#

  • how get dpi scale factor
    L Le rner

    i have 4k laptop its by default resolution is 200%

    C#

  • how get dpi scale factor
    L Le rner

    var graphics = control.CreateGraphics()) int dpi_scale_val= graphics.DpiX; but it always return 96

    C#
  • Login

  • Don't have an account? Register

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