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
U

Umangj

@Umangj
About
Posts
20
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Arranging more than one image having transparent pixels....
    U Umangj

    Yes I have tried tht... but it didnt work as it was also putting the transparent pixels also in the bmp formed...and i was skipping the transparent pixels than it was also skipping the transparent pixels at the bottom of the image... Isnt there any image container tht let see through the image on to the image behind it.... ofcourse picturebox and button isnt working or am I doing something wrong?

    C# csharp announcement

  • Arranging more than one image having transparent pixels....
    U Umangj

    Here, I have two images.... both of which has transparency in it.... They look a bit like this.... http://img167.imageshack.us/img167/1263/piece00.png http://img129.imageshack.us/img129/9712/piece03.png Language I am coding in is C#. I am trying to overlap these two images(or the puzzle pieces) such that the result looks like that they fit into one another..... I have tried all sorts of things to do it but failed. I have put these 2 images into 2 pictureboxes and set the backcolor as transparent but tht didnt worked.... code:

    PictureBox[] p = new PictureBox[2];
    p[0] = new PictureBox();
    p[1] = new PictureBox();
    p[0].BackColor = Color.Transparent;
    p[1].BackColor = Color.Transparent;
    p[0].Size = new Size(100, 100);
    p[1].Size = new Size(100, 100);
    p[0].Location = new Point(100, 100);
    p[1].Location = new Point(180, 100);
    p[0].Image=(imageList1.Images[0]);
    p[1].Image=(imageList1.Images[1]);
    p[0].Visible = true;
    p[1].Visible = true;

            this.Controls.Add(p\[1\]);
            this.Controls.Add(p\[0\]);
            p\[0\].Refresh();
            p\[1\].Refresh();
            p\[0\].Update();
            p\[1\].Update();
    

    I have also tried doing the same with buttons using:

    button1.BackgroundImage=image1;
    button2.BackgroundImage=image2;

    But both pictureboxes and buttons resulted in something like this: http://img148.imageshack.us/img148/5701/try1.jpg[^]

    C# csharp announcement

  • join pieces in an image
    U Umangj

    Its not begging, its called manners while asking for some help.... And it will be better if you can reply to the question asked and not how it is asked....

    C# csharp help tutorial

  • join pieces in an image
    U Umangj

    Here, I can see which pixels are transparent... Now, if I build each row again using only non transparent pixels then there will be problem at the last rows of each puzzle piece as the transparent color there need not to be shifted as the puzzle piece below it will fill it..... Thank you for replying...

    C# csharp help tutorial

  • join pieces in an image
    U Umangj

    For You: I just want to know how should i move the pixels so tht transparency between the pieces is gone.I have tried shifting the pixels row by row and also column by column but that is not working.... jus tell me any other way to do this....

    C# csharp help tutorial

  • join pieces in an image
    U Umangj

    heyyy pls help me... i need to join these puzzle pieces in an image..... the gap in b/w the pieces is the transparent color where alpha component of the pixel is 0, for example: i need to change an image from this: http://www.freeimagehosting.net/uploads/th.61647e9923.jpg to this: http://www.freeimagehosting.net/uploads/th.11322f3595.jpg

    C# csharp help tutorial

  • Click images with webcam using c#
    U Umangj

    i want to capture images using a webcamera in c#... whenever the user wants i.e. by clicking a button alongside....

    C# csharp help tutorial question

  • Click images with webcam using c#
    U Umangj

    Hey guys, I need to click pictures using a webcam.... in c#..... how to do it??? Any reference or link will help a lot... Waiting for ur reply Umang Jain

    C# csharp help tutorial question

  • transparent pictureboxes in C#
    U Umangj

    can a panel open multiple images together.... if not then how to do it.. as i have more than 1 no. of transparent images to open :confused:??? if yes.... then i'll go forward with it..... Thank you all for replying.... ;)

    .NET (Core and Framework) csharp question

  • transparent pictureboxes in C#
    U Umangj

    language: C# I am trying to set a no. of pictureboxes containing an image( image being a transparent image) of its own. Is there any way to set these pictureboxes over one another so that the image of one picturebox below another picturebox can be seen( as the images set over them are transparent)????

    .NET (Core and Framework) csharp question

  • Exception handling
    U Umangj

    Thank you so much... Your help made it work... i used

    FileStream fs;
    fs =System.IO.File.Create("d:\\puzzlesolver\\pieces\\"+ze.Name,2048,FileOptions.Asynchronous);

    and write the stream on to this file.... ;)

    .NET (Core and Framework) help

  • Dynamic picturebox allocation
    U Umangj

    Thnk you for replying..... i was successfully able to handle the problem that i was facing

    .NET (Core and Framework) csharp graphics help tutorial announcement

  • Exception handling
    U Umangj

    I m trying to open a zip file selected by user and extracting it.... It runs fine for the first time but when i again clicks on the open file button and selects a zip file. It throws an exception: The process cannot access the file "file.png" because it is being used by another process Note: file.png being one of the files extracted from the .zip file. I think the FileStream object is not releasing the file after opening it. I tried using f.Destroy() and f.close() but they didnt work. Also the code runs for the first time successfully and it creates an error when another .zip file is opened (using the openfiledialog box) after opening the first file successfully.

    String filename = openFileDialog1.FileName;

                ZipInputStream zis = null;
    
                FileStream f = new FileStream(filename, FileMode.Open);
                
                zis = new ZipInputStream(f );
                ZipEntry ze=null;
                while ((ze = zis.GetNextEntry()) != null)
                {
                    FileStream fs = null;
                    fs =System.IO.File.Create("d:\\\\puzzlesolver\\\\pieces\\\\"+ze.Name);
                    int size = 2048;
                    byte\[\] data = new byte\[2048\];
                    
                    while (true)
                    {
                        
                        size = zis.Read(data, 0, data.Length);
                        if (size > 0)
                        {
                            fs.Write(data, 0, size);
                        }
                        else
                        {
                            break;
                        }
                    }
    
                    fs.Close();
                }
                //f.Flush();
                f.Close();
                f.Dispose();
                zis.Close();
                zis.Dispose();
    
    .NET (Core and Framework) help

  • Dynamic picturebox allocation
    U Umangj

    heyy, please reply to this question guys................

    .NET (Core and Framework) csharp graphics help tutorial announcement

  • Dynamic picturebox allocation
    U Umangj

    I am creating n pictureboxes and then setting a different image on each one of them in a loop. The user clicks on open n opens a .zip file (containing images only). I am unzipping the .zip contents in a folder and am able to extract the images from there.For the first time the pictureboxes rightly shows the images. But when again user click on the open button and select a .zip file to be opened. The new images doesnt appear completely. Problem could be: previous images are not getting removed so are not allowing the new images to appear. Language: c# code:

    pb = new PictureBox[r*c];
    Point point = new Point(100, 100);

            //pb.Image = null;
    
            for (i = 0; i < r \* c; i++)
            {
                pb\[i\] = new PictureBox();
               
                {
                    pb\[i\].Dispose();
                }
                
                pb\[i\].Image = null;
            }
            int w = 800 / r;
            int k = 0;
            int h = 700 / c;
            int a = w, b = h;
            for (i1 = 0; i1 < r; i1++)
            {
                b = 15;
                for (i2 = 0; i2 < c; i2++)
                {
                    
                   // this.TransparencyKey = Color.Transparent;
                    //pb.BackColor = Color.Transparent;
                    pb\[k\] = new PictureBox();
                    pb\[k\].Image = null;        
                    pb\[k\].Size = new Size(w, h);
                    this.Controls.Add(pb\[k\]);
                    if (i1 == 0 )
                    {
                        pb\[k\].Location = new Point(10, b);
                    }
                    else
                    {
                        pb\[k\].Location = new Point(a, b);
                    }
                    //a = a + w;
                    b = b + h;
                    Bitmap img=new Bitmap("d:\\\\puzzlesolver\\\\pieces\\\\piece"+i2.ToString()+i1.ToString()+".png");
                    Bitmap img1 = new Bitmap(img);
                    pb\[k\].Image = img1;
                    pb\[k\].SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
                    pb\[k++\].Update();
                    this.Update();
                   // img.Dispose();
                    
                }
                a = a + w;
            }
            this.Update();
    

    I have tried a lot of things please tell me how to remove the existing picture boxes which are dynamically allocated and then add them ag

    .NET (Core and Framework) csharp graphics help tutorial announcement

  • Please help!!
    U Umangj

    Language:c# what i want to do: Open many images in 1 picture box??? Is it possible??? If yes, will this allow me to move the images and place them anywhere on the picturebox(even over one another) and how?? If not then how to open many images together in one form and allowing the user to place them wherever they want to(even over one another)???? Please help,,, i hope m clear enough...

    .NET (Core and Framework) csharp help tutorial question

  • pls help
    U Umangj

    Heyy, I want to alter an image. jus need to change color of some pixels in an image. What i m doing is this: FileStream f = new FileStream("d:\\puzzlesolver\\puzzle\\piece" + i.ToString() + ".jpg", FileMode.Open, FileAccess.ReadWrite); Bitmap bmp = new Bitmap(f); f.Close(); bmp.SetPixel(n, j, Color.IndianRed); [note]: n,j are within the cordinates of the image. but after running the code successfully m not able to change the color of the pixels...What am i doing wrong here?? pls help....

    .NET (Core and Framework) graphics help question

  • help needed pls
    U Umangj

    Thank you so much... it worked... prob. solved

    .NET (Core and Framework) graphics help question

  • help needed pls
    U Umangj

    Thank you for replying but how do i paint it on the image... ???

    .NET (Core and Framework) graphics help question

  • help needed pls
    U Umangj

    I am opening an image on a picturebox using: pictureBox1.Image = new Bitmap(openFileDialog1.FileName); then i am drawing some lines and curves on the picturebox using the event: private void pictureBox1_Paint(object sender, PaintEventArgs e) such that the painted lines and curves are drawn over the image opened on the picturebox. Now, I want to save the image containing the original image and the lines or curves drawn on the picturebox as one image. Please tell how do i do that........ Thank You Umang Jain

    .NET (Core and Framework) graphics help question
  • Login

  • Don't have an account? Register

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