Loading an Image/Picture from memory
Posted
#1
(In Topic #170)
Trainee
I'm working on an image/animation editor. My editor needs to be able to import multiple images, stored as separate layers, which are eventually saved out in a custom file format.
Currently I have images being loaded in from their location on the filesystem:
Code
newLayer.B64Image = Base64$(File.Load(imagePath))
for example:
Code
- image:
- Name: dogs
- B64Image: abcdef[etc]
- image:
- Name: cats
- B64Image: abcdef[etc]
I've seen a couple solutions that involve writing out to temporary files, but I'd like to avoid that.
I see in the documentation that
Code
Picture.FromString()Thanks!
Posted
Regular

why Base64 ?
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Trainee
Switching from b64 to bytes is a function call away, so if it's easier to think about, I suppose I should have posed the question like:
I have read in a PNG as a string of bytes, and I am looking for a way to convert that string of bytes to an Image or Picture type, to display to a canvas.
Posted
Regular

computermouth said
I have read in a PNG as a string of bytes, and I am looking for a way to convert that string of bytes to an Image or Picture type, to display to a canvas.
…and this's my code:
Code
Public Sub Form_Open()
Dim pc As Picture
pc = Picture.FromString(File.Load("/path/of/file.png"))
PictureBox1.Picture = pc
End
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
1 guest and 0 members have just viewed this.



