How do I load an image from PC hard drive?

Get help using Construct 2

Post » Wed Oct 14, 2015 2:25 pm

Just trying two simple tests:

1. When a layout starts, load an image from the PC hard drive. I've tried:

On Start of Layout - Sprite - Load Image from "C:\Documents and Settings\Private\Desktop\PicFile.jpg

Nothing happens.

2. Use File chooser to get, load, and SHOW a picture file from the PC hard drive. I'm about to get to the file search to activate, but I don't know how to get a file and make it show.

I tried to do these the way I used to do with them with Construct Classic, but it doesn't appear to be the same or maybe I'm missing something.

Any help will be greatly appreciated.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Wed Oct 14, 2015 2:40 pm

@dwilatifah

Sorry, but you're posting in the wrong place. You need to start you own thread.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Wed Oct 14, 2015 2:41 pm

I understand how he meant formula, please clue?
B
7
S
3
Posts: 7
Reputation: 656

Post » Wed Oct 14, 2015 3:13 pm

dwilatifah wrote:I understand how he meant formula, please clue?


Please stop multi-posting and cross-posting the same question.

Post your question in the 'How Do I' section and wait for a response.

It is acceptable to 'bump' your own post after 24 hours if their hasn't been a response.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Wed Oct 14, 2015 9:23 pm

Layout

Add a File Chooser Object

Add an Empty Sprite

Event Sheet

On File Chooser Changed - Image Sprite - Load Image from FileChooser.FileURLAt(0)

Select Resize Sprite to Image if you want.

Done
Image
B
45
S
17
G
2
Posts: 201
Reputation: 4,471

Post » Thu Oct 15, 2015 1:00 am

Hi VictoryX,

I really appreciate the look! But it's still not working. I'm not sure what I'm doing wrong.

I went

File Chooser - On Changed --> Sprite - Load Image from "FileChooser.FileURLAt(https://pbs.twimg.com/profile_images/63 ... 2v9f8Z.jpg)"

And nothing. Tried a local file, and still, nothing.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Thu Oct 15, 2015 1:57 am

Image
Image
B
64
S
23
G
7
Posts: 1,481
Reputation: 10,823

Post » Thu Oct 15, 2015 6:29 pm

Ah, got it. Thanks, korbaach!
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Fri Oct 16, 2015 2:29 am

Hey, does anyone if there is a way to change the text of the FileChooser button? Or is this hardcoded?
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Fri Oct 16, 2015 5:24 am

Image
B
64
S
23
G
7
Posts: 1,481
Reputation: 10,823

Next

Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 6 guests