×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Jan 2014
    Posts
    145

    How to copy RGB pixels from one to another bitmap?

    I'll explain my scenario with pictures for better understanding.



    1. What I want is the pixel width and height of the rgb pixels and create a new bitmap with those dimensions and copy RGB area pixels into it.

    2. It would be even better if I can copy only the RGB area into a new bitmap without the transparent part (Is it possible?)

    3. Else, Is there any other alternative?

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2011
    Location
    la bouexiere, france
    Posts
    474

    Re: How to copy RGB pixels from one to another bitmap?

    hi
    Quote Originally Posted by venu238 View Post
    1. What I want is the pixel width and height of the rgb pixels and create a new bitmap with those dimensions and copy RGB area pixels into it.
    => reframing filter to selection your RGB rect
    => BitmapRenderer or WritealbeBitmapRenderer to copy the RGB area

    2. It would be even better if I can copy only the RGB area into a new bitmap without the transparent part (Is it possible?)
    what do you mean by "without the transparent part" ?
    Windows 8, Windows phone 8 or Nokia Asha developer? Go to DVLUP

  3. #3
    Regular Contributor
    Join Date
    Jan 2014
    Posts
    145

    Re: How to copy RGB pixels from one to another bitmap?

    1. How should I select a rectangle around the RGB?

    2. Copying RGB pixels without alpha channel pixels into a new irregular shaped image

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,740

    Re: How to copy RGB pixels from one to another bitmap?

    Quote Originally Posted by venu238 View Post
    1. How should I select a rectangle around the RGB?
    I do not know if there is some magical filter for that, but a simple pair of for loops can certainly get the rectangle
    Code:
    int minx=Int.MaxValue,miny=Int.MaxValue,maxx=Int.MinValue,maxy=Int.MinValue;
    for(int y=0;y<height;y++)
        for(int x=0;x<width;x++)
            if(getpixel(x,y)!=0)
            {
                if(minx>x)minx=x;
                if(maxx<x)maxx=x;
                if(miny>y)miny=y;
                if(maxy<y)maxy=y;
            }
    2. Copying RGB pixels without alpha channel pixels into a new irregular shaped image
    Is there such thing as an "irregular shaped image"?

  5. #5
    Regular Contributor
    Join Date
    Jan 2014
    Posts
    145

    Re: How to copy RGB pixels from one to another bitmap?

    1. Thanks for the reply, maybe GetPixel method is little time consuming..Is there any other alternative?

    2.sorry language problem, I mean to say that copy RGB pixels to a path figure..
    Last edited by venu238; 2014-03-17 at 13:54.

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2011
    Location
    la bouexiere, france
    Posts
    474

    Re: How to copy RGB pixels from one to another bitmap?

    Quote Originally Posted by venu238 View Post
    1. How should I select a rectangle around the RGB?
    you want somethings automatic??

    Quote Originally Posted by venu238 View Post
    2. Copying RGB pixels without alpha channel pixels into a new irregular shaped image
    blend mode it's certainly the simplest. For the background, you could use a ColorImageSource
    Windows 8, Windows phone 8 or Nokia Asha developer? Go to DVLUP

  7. #7
    Regular Contributor
    Join Date
    Jan 2014
    Posts
    145

    Re: How to copy RGB pixels from one to another bitmap?

    Yeah I need something automatic..it will be user friendly.

    I have got the rectangle dimensions with the help of "wizard_hu_".. what should I do next?
    Use reframing filter?
    Last edited by venu238; 2014-03-17 at 21:11.

  8. #8
    Nokia Developer Champion
    Join Date
    Nov 2011
    Location
    la bouexiere, france
    Posts
    474

    Re: How to copy RGB pixels from one to another bitmap?

    Reframing filter will do the stuff
    Windows 8, Windows phone 8 or Nokia Asha developer? Go to DVLUP

Similar Threads

  1. How to copy a bitmap
    By pawan_G in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2008-11-18, 06:37
  2. copy a bitmap
    By fagiano in forum Symbian
    Replies: 1
    Last Post: 2007-09-18, 14:16
  3. how to copy a rect from bitmap to another
    By ceehira in forum Symbian
    Replies: 1
    Last Post: 2005-08-22, 16:22
  4. how to copy a bitmap?
    By nkn_motoko in forum Symbian
    Replies: 2
    Last Post: 2004-04-29, 08:25
  5. Can't copy bitmap to back buffer. help please
    By itenel in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-04-06, 08:51

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×