Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Type or namespace "RectangleF' could not be found (are you missing a using directive or assembly reference) #34

Open
robreno opened this issue May 2, 2023 · 1 comment

Comments

@robreno
Copy link

robreno commented May 2, 2023

  1. RectangleF: Error CS0246 The type or namespace name 'RectangleF' could not be found (are you missing a using directive or an assembly reference?)

  2. Quick Actions adds: "using System.Drawing" but this creates a conflict with Maui.Graphics and is the incorrect Rect type for
    the following line of code "canvas.FillRectangle(rect)" and other Maui.Graphics references (e.g., Color, convas, etc.).

  3. To test I added "using SDraw = System.Drawing" yielding SDraw.RectangleF rect = new( ... but as noted above RectangleF is wrong type for "canvas.FillRectangle(rect)".

  4. Added following and worked correctly:

Rect newRect = new(
                    x: columnIndex * cellWidthPx + xPad,
                    y: rowIndex * cellHeightPx + yPad,
                    width: cellWidthPx - xPad * 2,
                    height: cellHeightPx - yPad * 2);
canvas.FillRectangle(newRect);
  1. Fix is to use Maui.Graphics.Rect (rather than System.Drawing.RectangleF) .
@robreno
Copy link
Author

robreno commented May 2, 2023

I am so grateful for all the work you have done and the code you have shared. It will help greatly in a Maui project I am working on at this time where I am developing audiobooks with .NET Maui. I need to analyze an audio (MP3 or WAV) input file and use AI and Machine Learning to identify the point between paragraphs in the accompanying text so I can create a tap-n-play paragraph only feature. I have already found the bracketed start and end of each paragraph but to fine tune the actual middle-point (lowest frequency point) between paragraphs I want to use AI to auto-locate the lowest frequency point to make processing large audio files easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant