# Cvb.Foundation.Scale

**URL:** <https://forum.commonvisionblox.com/t/cvb-foundation-scale/1238>\
**Category:** .Net API\
**Created:** [October 12, 2020, 1:32pm UTC](https://forum.commonvisionblox.com/t/cvb-foundation-scale/1238 "2020-10-12T13:32:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarSch](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/marsch/32/23_2.png) [@MarSch](https://forum.commonvisionblox.com/u/MarSch)\
**Post date:** [October 12, 2020, 1:32pm UTC](https://forum.commonvisionblox.com/t/cvb-foundation-scale/1238/1 "2020-10-12T13:32:40Z")

</div>

Good afternoon,

when scaling image data, I just realized that the function

`Cvb.Foundation.Scale.To32BppFloat(MyImage.Planes[0].Map(), 0.0, 1.0);`

raises an exception, whereas

`Cvb.Foundation.Convert.To32BppFloat(MyImage.Planes[0].Map());`

executes without any problem. The source MyImage.Planes[0].Map() is a 16 bit unsigned image.

I would have expected that both of them work. Is this a misconception on my side?

This is the exception:

```
System.NotSupportedException
  HResult=0x80131515
  Nachricht = 
  Quelle = Stemmer.Cvb
  Stapelüberwachung:
   at Stemmer.Cvb.Runtime.InteropServices.Processing.GenericInvocation(StandardProcessingFunctionImg fn, ReturnCodeTranslation returnCodeTranslator)
   at StreamDisplay.MainForm.OnProcessing() in D:\MainForm.cs:line 329
   at StreamDisplay.MainForm.OnNewImage() in D:\MainForm.Streaming.cs:line 156
   at StreamDisplay.MainForm.<.ctor>b__8_1(Object s, ImageEventArgs e) in D:\MainForm.cs:line 52
   at Stemmer.Cvb.Forms.Components.StreamHandler.<>c __DisplayClass15_0.<ContextSendMessage>b__ 0(Object _)

Innere Ausnahme 1:
CvbException:
```

---

<div class="post-metadata">

**Author:** ![rtp\_derahs](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/rtp_derahs/32/79_2.png) [@rtp\_derahs](https://forum.commonvisionblox.com/u/rtp_derahs)\
**Post date:** [October 12, 2020, 3:22pm UTC](https://forum.commonvisionblox.com/t/cvb-foundation-scale/1238/2 "2020-10-12T15:22:53Z")

</div>

Hi @MarSch,

I can indeed reproduce this… 😒  
It seems like it only throws on 16bit source images.  
I will investigate this problem and let you know as soon as I know more!

---

<div class="post-metadata">

**Author:** ![illusive](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/illusive/32/61_2.png) [@illusive](https://forum.commonvisionblox.com/u/illusive)\
**Post date:** [October 13, 2020, 5:56am UTC](https://forum.commonvisionblox.com/t/cvb-foundation-scale/1238/3 "2020-10-13T05:56:30Z")

</div>

Hi,

I am sorry but the underlying `ScaleTo32BPPFloat` function only digests 8 bit unsigned input data.

---

<div class="post-metadata">

**Author:** ![MarSch](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/marsch/32/23_2.png) [@MarSch](https://forum.commonvisionblox.com/u/MarSch)\
**Post date:** [October 13, 2020, 6:44am UTC](https://forum.commonvisionblox.com/t/cvb-foundation-scale/1238/4 "2020-10-13T06:44:53Z")

</div>

Hi Volker,

do you consider to extend this to 16 to 64 bit unsigned types in future versions?

Thank you,

Markus

/mobile

---

<div class="post-metadata">

**Author:** ![illusive](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/illusive/32/61_2.png) [@illusive](https://forum.commonvisionblox.com/u/illusive)\
**Post date:** [October 13, 2020, 7:49pm UTC](https://forum.commonvisionblox.com/t/cvb-foundation-scale/1238/5 "2020-10-13T19:49:49Z")

</div>

Generally: Why not? However this will not be available short term…
