Saturday, December 17, 2011 4:20 AM
Request method to call graphics ie:- for example JPEG images from "My Pictures" into the current exercise.
I was doing fine up to attempting to import graphics into the Example Lessons. My previous experience
with Basic was many years ago so please be kind !! ... If someone could provide a few lines that will work
would be great, I love the book and the program, I'm attempting to import pictures from Windows 7 "My Pictures" ??
Saturday, December 17, 2011 6:41 AMShapes.AddImage(src)
Saturday, December 17, 2011 7:04 AM
The following code works for me. You must include the full menu path including the file name extension (.jpg). For some reason I cannot get it to work directly from the Documents folder but I copy the image into a folder on the C: drive and have no problems.
GraphicsWindow.Height = 600 GraphicsWindow.Width = 900 pic = "C:\SB Data\Tulips.jpg" GraphicsWindow.DrawResizedImage(pic,0,0,900,600)
UPDATE I just had another try at getting the image directly from the Sample Pictures folder and it worked. The new code is below.
GraphicsWindow.Height = 600 GraphicsWindow.Width = 900 pict = "C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg" GraphicsWindow.DrawResizedImage(pict,0,0,900,600)
The menu path on my display read ...Users\Public\Public Pictures\Sample Pictures... which I think I must have used in the past (and failed) but the path in the above code works fine.
Saturday, December 17, 2011 7:30 AM
Hi Kiwi Bert
Thanks for that, off to our Photo Group Xmas function now and will try that tomorrow.
again thanks for prompt reply much appreciated.
Saturday, December 17, 2011 2:01 PM
Here's what finally worked for me
GraphicsWindow.Title = "Whatever"
GraphicsWindow. Width = 400
GraphicsWindow.Height = 300
pict = C:\Program Files\Queen.jpg
In this case I didn't need to resize, thanks again for the code lines I can now get on with the next Example
Thursday, December 22, 2011 5:23 AM
Hello again Bert
The line you gave me will load image OK so that's a solution ,however attempting to follow (The Developers Reference Guide) lines for example :-
Burger= ImageList.LoadImage(Program.Directory + "\burger.gif) doesn't work for me.
I'm normally ok with file management, but having trouble with this program line to locate files, I'm missing something , the good book - 'The Developers Reference Guide to Small Basic " refers to sample images in Guide to Small Basic \Programs\Chapter 9, I've have no success locating those samples .
Likewise the images from the My Pictures Folder will load with the line you gave me etc.but not " ImageList.LoadImage etc. or Program.Directory.
I'm following the book (all 500 pages ) there doesn't seem to be a help location specific to the book ? I guess I'm looking for help with file structure
for it ..!
PS The book is designed for 10 years up, I have 60 years head- start, guess it is not enougn !!
Thursday, December 22, 2011 6:38 AM
I do not have the Developers Reference Guide but after reading your post I have written a two line program (listed below) that works for me.
Burger = ImageList.LoadImage("C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg") GraphicsWindow.DrawImage(Burger,0,0)
I am reading the Program.Directory + line as an instruction to list the address path within the brackets. I don't know if I am on the right track here but let me know either way. If we stiil need help we will have to contact a 14 year old as (if I have interpreted the numbers correctly) I have 7 years start on you.
Good Luck, let us know either way.
Thursday, December 22, 2011 10:44 AM
What "We" probablly need is somebody who knows this book ie:- " The Developers Reference Guide to Small Basic "
I'm about a third way through the book and stalled until I get the file structure right . It may not be appropriate for me
to post a full code block here for you to look at, failing all else I'll get back to the distributors maybe.
Ps 7 years = 78
Thanks for the interest and I will let you know, looks like I need a lesson in file structure for this book\program.
I'm happy with the book\program once I get over this "hiccup"...
Once again thank you .
- Marked As Answer by Keith Art Sunday, December 25, 2011 8:36 AM
Wednesday, January 25, 2012 6:59 PM
I just stumbled onto the posts above and noticed that you had a question about the Developer's Reference Guide to Microsoft Small Basic graphics files and how to get them. If you purchased the textbook or EBook directly from our Computer Science For Kids website we would have emailed you a download link to the Small Basic Source Code and the associated graphics in a compressed .zip file.
If you purchased the Developer's Reference Guide to Microsoft Small Basic from a 3rd party book store (e.g. Amazon.com), you can download the associated solutions and graphics file free of charge from this specific download webpage on our ComputerScienceForKids.com website.