Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 67020

Re: Can't find usings when upgrading to .NET8

$
0
0

Hi @LPow 

 

Kindly follow the below steps,

 

1. Got to the csproj and the below PackageReference.

 

<ItemGroup><FrameworkReference Include="Microsoft.WindowsDesktop.App"/></ItemGroup>

 

 

2. Declare namespaces

 

using System.Drawing; using System.Windows.Media.Imaging;

 

 

3. Reference Code Snippet

 

private BitmapImage BitmapToImageSource(Bitmap BMapm) { using MemoryStream mem = new MemoryStream(); BMapm.Save(mem, ImageFormat.Jpeg); mem.Position = 0; BitmapImage bmi = new BitmapImage(); bmi.BeginInit(); bmi.StreamSource = mem; bmi.CacheOption = BitmapCacheOption.OnLoad; bmi.EndInit(); return bmi; }

Sorry in the above code I have missed the class name after using keyword

 

Hope this will Helps 🙂

 


Viewing all articles
Browse latest Browse all 67020

Latest Images

Trending Articles



Latest Images

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