mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #188] Accessing Qt classes from c# #121
Labels
No labels
bug
enhancement
help wanted
help wanted
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/qmlnet#121
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Blquinn on GitHub (Mar 12, 2020).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/188
Hello, thanks for the great lib!
I have an application where I need to do some image manipulation. It is a CT scan viewer / CAD style program. Therefore I need to be able to manipulate images, create overlays, zoom and all sorts of other stuff. My preference would be to do this in c# code and just have the qml call functions in my c# code.
Is it possible to have the qml layer simply present an image that lives in my c# code and not just load an image with
srcin the image component? I could probably use a hack and continuously write the image to disk and reload it in qml, but I'd prefer to do something more similar to what you can do in native c++.Thank you for any input!
@pauldotknopf commented on GitHub (Mar 12, 2020):
You can expose the image as an array of bytes.
Or, create a pointer in C#, manage memory in C# (overlay, etc), and expose it via QML (this would require some C++ though).
@Blquinn commented on GitHub (Mar 12, 2020):
Thanks for the quick response :)
I don't mind writing a bit of c++ if it means I can do most of my heavy logic in c#.
So I could probably use bitmaps (hopefully some higher level library in c#) and access its data directly in qml? How would I access that image data in qml?
Sorry, I know relatively little about c# <> c++ interop and how qml fits into the equation.