Lyrcaxis
Lyrcaxis
CC#
Created by Silme94 on 12/31/2024 in #help
BAD IMAGE QUALITY (Bitmap)
ok now I see you're querying about saving it, not loading it. You can do the same:
using var m = new MemoryStream();
image.Save(memoryStream, ImageFormat.Png);
return m.ToArray();
using var m = new MemoryStream();
image.Save(memoryStream, ImageFormat.Png);
return m.ToArray();
Then System.IO.File.WriteAllBytes.
11 replies
CC#
Created by Silme94 on 12/31/2024 in #help
BAD IMAGE QUALITY (Bitmap)
So something like: ImageBytes = Utils.GetGraphic(path); and rendering via <Image Source="{Binding ImageBytes}"/>
11 replies
CC#
Created by Silme94 on 12/31/2024 in #help
BAD IMAGE QUALITY (Bitmap)
For reference I stopped having to deal with Bitmap in favour of storing everything as bytes:
public static byte[] GetGraphic(string path) {
using var m = new MemoryStream();
var image = System.Drawing.Image.FromFile(path);
image.Save(m, image.RawFormat);
return m.ToArray();
}
public static byte[] GetGraphic(string path) {
using var m = new MemoryStream();
var image = System.Drawing.Image.FromFile(path);
image.Save(m, image.RawFormat);
return m.ToArray();
}
11 replies
CC#
Created by malkav on 9/8/2022 in #help
Get multiple substrings from a main string
I f to doubt but sure 🙂 gl
94 replies
CC#
Created by malkav on 9/8/2022 in #help
Get multiple substrings from a main string
Is it? There are regex expressions that do just that in 1 line
94 replies
CC#
Created by malkav on 9/8/2022 in #help
Get multiple substrings from a main string
Smith like <img>xxx.png</img>
94 replies
CC#
Created by malkav on 9/8/2022 in #help
Get multiple substrings from a main string
Check out how tag parsers work
94 replies
CC#
Created by JansthcirlU on 9/8/2022 in #help
Simulation or game loop using async-await and events [Answered]
Sure.. probably ;P
19 replies
CC#
Created by JansthcirlU on 9/8/2022 in #help
Simulation or game loop using async-await and events [Answered]
19 replies
CC#
Created by JansthcirlU on 9/8/2022 in #help
Simulation or game loop using async-await and events [Answered]
aw, thanks
19 replies
CC#
Created by JansthcirlU on 9/8/2022 in #help
Simulation or game loop using async-await and events [Answered]
you can build your engine/loop around async logic, but you have to be ok with stuff not running in order
19 replies
CC#
Created by JansthcirlU on 9/8/2022 in #help
Simulation or game loop using async-await and events [Answered]
namely: if you care about execution order, do it single threaded
19 replies
CC#
Created by JansthcirlU on 9/8/2022 in #help
Simulation or game loop using async-await and events [Answered]
game loops are usually linear and on a single thread for a reason
19 replies
CC#
Created by JansthcirlU on 9/8/2022 in #help
Simulation or game loop using async-await and events [Answered]
ah right, had to participate first
19 replies
CC#
Created by JansthcirlU on 9/8/2022 in #help
Simulation or game loop using async-await and events [Answered]
19 replies