Quantcast
Channel: WriteableBitmapEx
Viewing all 360 articles
Browse latest View live

Closed Issue: Bug in Crop when width/height is same as the source width/height [15084]

$
0
0
When using the .Crop function with the same width (or height) as the source width (or height) , the returned result is one pixel smaller.
 
Dim img As New WriteableBitmap(100, 100)

Dim img2 As WriteableBitmap = img.Crop(0, 0, 50, 50)
'Correct : returns a 50x50 image
 
Dim img3 = img.Crop(0, 0, 100, 50)
'Bug? : returns a 99x50 image , expected 100x50

Closed Issue: DrawLine is not working correctly for boundary points [14941]

$
0
0
The DrawLine method is not drawing all the points between the starting (x,y) point and the ending (x2,y2) points. For example you can create a new WriteableBitmap having (10,10) size and try to draw the line from (0,0) to (9,9). The latest point (9,9) will not be affected by the DrawLine method. I suspect there is a boundary check which stops drawing before the ending point is reached.

Closed Feature: Add Convolute method [14796]

$
0
0
Add the Convolute method as suggested here
http://writeablebitmapex.codeplex.com/Thread/View.aspx?ThreadId=236374&ANCHOR#Post528218
 
Todo:
The alpha value should be preserved.
Use rectangular array as kernel parameter to avoid kernelwWdth and kernelHeight parameters.
Optimizations.
The values should wrapped at the borders.

Closed Task: Windows Phone release [14361]

$
0
0
Starting with version 1.0 a ready-to-use WP7 built should be provided.

Closed Issue: GetPixel Bug? [14151]

$
0
0
I think I found a bug in GetPixel, there are some casts missing for retrieving the colour components. You should be able to reproduce the issue by looping over the pixels and doing bmp.SetPixel(x,y,bmp.GetPixel(x,y))
 
WriteableBitmapBaseExtensions.cs Line 170
return Color.FromArgb(a, (byte)((c >> 16) * ai), (byte)((c >> 8)* ai), (byte)(c * ai));
Fix:
return Color.FromArgb(a, (byte)((byte)(c >> 16) * ai), (byte)((byte)(c >> 8)* ai), (byte)((byte)c * ai));
 
I did try to create and upload a patch but for some reason the mime type of the file was jpeg, I don't know if that is because my TortoiseSVN is slightly out of date or if the problem lies elsewhere.

Closed Feature: Flip methods [13816]

$
0
0
Implement FlipHorizontal and FlipVertical methods.

Closed Issue: Bug on WriteableBitmapExtensions.cs [13563]

$
0
0
At line 63, actual code:
int h = bmp.PixelWidth;
 
Right code:
int h = bmp.PixelHeight;

Closed Feature: 90° Rotate methods [13362]

$
0
0
To make the transformation methods complete, a Rotate method should be added with support for 90° steps.

Closed Issue: Clip DrawEllipse at boundaries [12552]

$
0
0
See [discussion:208643]
http://writeablebitmapex.codeplex.com/Thread/View.aspx?ThreadId=208643

Closed Feature: Add parametric Curve method [11054]

$
0
0
Implement a DrawBezier() and DrawCurve() method to support parametric curves / splines.

Closed Feature: Add Fill methods [11053]

$
0
0
Implement various Fill*() methods as addition to the Draw*() methods like FillEllipse(), FillRect(), ...

New Post: Resizing Image distorts its pixels around corners

$
0
0
Hi!

I needed to resize an image so I used following code:
            WriteableBitmap img2 = new WriteableBitmap((int)width, (int)height);
            img2 = img.Resize((int)width, (int)height, WriteableBitmapExtensions.Interpolation.Bilinear);
destination.Blit(new Rect(coords.X, coords.Y, img2.PixelWidth, img2.PixelHeight), img2, new Rect(0,0, img2.PixelWidth, img2.PixelHeight));
            return destination;
But when i save this destination image it becomes distorted around the edges and gives me this image:
Image

Any ideas for what can be wrong here?

New Post: Saving Image without change a pixel colors

$
0
0
Hello Admin,
First, I thanks for this library.. That's a wonderful library to get and set pixel image.
Now I in reasearch about image processing and I using this library, but I have a problem when
save image, function(saveJPEG or SavePicture) has changed all pixel color.
For Example data :
Pixel original before saving library :
Color[0] : R=239, B=242,G=234
Color[1] : R=238, B=237,G=232
Color[2] : R=240, B=241,G=233
Color[3] : R=237, B=238,G=233
Color[4] : R=236, B=240,G=233

Pixel after saved to library :
Color[0] : R=237, B=242,G=233
Color[1] : R=240, B=238,G=234
Color[2] : R=238, B=240,G=233
Color[3] : R=237, B=239,G=232
Color[4] : R=233, B=238,G=231

I copy my function when save to library in below :

Function 1 : Saving image to library
 String nameFile = "EncyptImage.jpg";
                var store = IsolatedStorageFile.GetUserStoreForApplication();
                if (store.FileExists(nameFile))
                {
                    store.DeleteFile(nameFile);
                }

        
                IsolatedStorageFileStream fileStream = store.CreateFile(nameFile);
                WriteableBitmap wb = GetNewImage(_colors);
                Extensions.SaveJpeg(wb, fileStream, wb.PixelWidth, wb.PixelHeight, 0, 100);
                fileStream.Close();
                fileStream = store.OpenFile(nameFile, FileMode.Open, FileAccess.Read);
                fileStream.Position = 0;
                MediaLibrary mediaLibrary = new MediaLibrary();
                Picture pic = mediaLibrary.SavePicture(nameFile, fileStream); 
                fileStream.Close();
Function 2 : Get new Image from colors
  private WriteableBitmap GetNewImage(Color[] _colors)
  {
      WriteableBitmap bmpImage = new WriteableBitmap(_image.PixelWidth, _image.PixelHeight);
            return bmpImage;
  }
I already tried change Extensions.SaveJpeg(wb, fileStream, wb.PixelWidth, wb.PixelHeight, 0, 100); in function 1 to wb.WriteTga(fileStream); but throw an exception : Value does not fall within the expected range.

If you know about saving image without change a pixel color in windows phone 7.1 or later, could you help me to solve this problem?


Thank you,

Regards,
Darmawan Efendi & Ahoy.

Reopened Feature: Add parametric Curve method [11054]

$
0
0
Implement a DrawBezier() and DrawCurve() method to support parametric curves / splines.

Reopened Feature: Add Fill methods [11053]

$
0
0
Implement various Fill*() methods as addition to the Draw*() methods like FillEllipse(), FillRect(), ...

New Post: getting started tutorials

$
0
0
Hello Everyone,

Thanks for providing such great library. I come across to this library today and wanted to start using all the functionality provided by library. But due to lack of documentation I could not jump start.

Can someone point to me blogs, tutorials etc to learn the basics of library and how to use it for its different features?

Thanks

New Post: getting started tutorials

$
0
0
On the homepage of this project you can find code snippets, links to more posts and in the source code repository are quite a few samples. It's the easiest to use a sample project and build on top of it.

https://writeablebitmapex.codeplex.com
  • Rene

New Post: getting started tutorials

$
0
0
I am confused with real use of this library. Why we should use this library? Can you please shed more light in scenarios where we should use this library.

Closed Issue: Blit with alpha channel does not work as expected [19679]

$
0
0
The issue reported here:
http://writeablebitmapex.codeplex.com/discussions/390628
was fixed on ChangeSet 93605 but now it is broken again.
Comments: I just spent some time to verify it and the most current version uses the right alpha blending formula. The WB uses pre-multiplied colors so multiplying it again with the alpha would be a double calc. Also see this: http://writeablebitmapex.codeplex.com/workitem/19133

You can verify it here:
```
var background = new WriteableBitmap(400, 400);
background.Clear(Color.FromArgb(255, 0, 255, 128));

var overlay = new WriteableBitmap(400, 400);
overlay.ForEach((x, y) =>
{
var a = (byte)(255 - (x / 400.0) * 255);
return Color.FromArgb(a, 255, 255, 255);
});

var rect = new Rect(0, 0, 400, 400);
background.Blit(rect, overlay, rect, WriteableBitmapExtensions.BlendMode.Alpha);

Img.Source = background;
```

Source code checked in, #101183

$
0
0
* Renamed Xna dependent class to avoid compiler naming conflicts
Viewing all 360 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>