View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001497 | NoesisGUI | C# SDK | public | 2019-06-19 17:12 | 2019-06-20 11:32 |
| Reporter | Vince_1990 | Assigned To | sfernandez | ||
| Priority | normal | Severity | feature | ||
| Status | resolved | Resolution | no change required | ||
| Product Version | 2.2.3 | ||||
| Summary | 0001497: BitmapImage from stream/byte[] | ||||
| Description | I have a database with images (Couchbase if it matters). It would there fore be awsome if we could just pass a stream/byte[] and get the ImageSource in return. OR an tutorial on how to use Bitmapsource.Create | ||||
| Platform | Windows | ||||
|
You should be able to use BitmapSource.Create just fine passing the byte array: byte[] pixels = memoryStream.ToArray(); Are you getting any error with this approach? |
|
|
Tried it but doesn't work. I don't know the pixels width.Height so i used: Bitmap b = new Bitmap(File.ContentStream); Result: The file is an .jpg file. |
|
|
I am not sure this is the best approach. If you already have the images in a database I think the best way is installing a TextureProvider that will allow you to return a Stream for each requested URI. |
|
|
I Already use a custom texture provider for loading images from filesystem, wich indeed needs an uri and spills out an stream. |
|
|
I think this is not a bug and it is better to discuss it in the forums, because it can help others in the same situation, could you please create a post there? |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2019-06-19 17:12 | Vince_1990 | New Issue | |
| 2019-06-19 17:12 | Vince_1990 | Tag Attached: C# | |
| 2019-06-19 17:31 | Vince_1990 | Summary | Load BitmapImage from stream => BitmapImage from stream/byte[] |
| 2019-06-19 17:41 | sfernandez | Assigned To | => sfernandez |
| 2019-06-19 17:41 | sfernandez | Status | new => feedback |
| 2019-06-19 17:41 | sfernandez | Note Added: 0005746 | |
| 2019-06-19 19:32 | Vince_1990 | Note Added: 0005747 | |
| 2019-06-19 19:32 | Vince_1990 | Status | feedback => assigned |
| 2019-06-19 19:33 | Vince_1990 | Note Edited: 0005747 | |
| 2019-06-19 19:34 | Vince_1990 | Note Edited: 0005747 | |
| 2019-06-19 19:43 | Vince_1990 | Note Edited: 0005747 | |
| 2019-06-19 20:17 | Vince_1990 | Note Edited: 0005747 | |
| 2019-06-19 20:40 | Vince_1990 | Note Edited: 0005747 | |
| 2019-06-20 10:21 | Vince_1990 | Note Edited: 0005747 | |
| 2019-06-20 10:22 | Vince_1990 | Note Edited: 0005747 | |
| 2019-06-20 10:53 | jsantos | Note Added: 0005750 | |
| 2019-06-20 10:53 | jsantos | Status | assigned => feedback |
| 2019-06-20 11:07 | Vince_1990 | Note Added: 0005751 | |
| 2019-06-20 11:07 | Vince_1990 | Status | feedback => assigned |
| 2019-06-20 11:32 | sfernandez | Status | assigned => resolved |
| 2019-06-20 11:32 | sfernandez | Resolution | open => no change required |
| 2019-06-20 11:32 | sfernandez | Note Added: 0005752 |