JttCotA: Part IV – The Code

Posted by on Dec 12, 2013 in DGST101 Blogs |

So I just added the code from the guide on making a flashlight to my page. I am getting permissions errors when I try to run it, but as of right now the code seems to be working fine. Well, it doesn’t throw any errors. I’m going to be writing a blog post here on the code that’s on that guide, and explain what is going on to the best of my ability. This is what we’ll be studying today, kids. I should first mention that all of this code is going in a button event handler. That means that I’m putting this into a section of code that is activated when you click on a button. In this specific case, my button basically takes up the entire screen. It’s nice. CameraSensorLocation camLocation = CameraSensorLocation.Back; It is apparently important to determine which camera I’m trying to use. This is essentially creating a variable named camLocation. This variable will only hold data on which camera I’m using, in this case I am telling it that camLocation should be the back camera. IReadOnlyList(object) CameraModes; This creates a list called CameraModes. This list can be filled with anything considered an object, and can’t be changed once the app is running. In my code, object is actually in “<>” instead of “()” but HTML doesn’t like that very much. CameraModes = AudioVideoCaptureDevice.GetSupportedPropertyValues(camLocation, KnownCameraAudioVideoProperties.VideoTorchMode); This takes that list we made in the last line, CameraModes, and fills it with all of the options regarding the LED light connected to the back camera on the phone. From what I saw, this is just on, off and auto. However, there might not be any LED light, in which case we need to check for that. if (CameraModes.ToList().Contains((UInt32)VideoTorchMode.On)) { This marks the beginning of a section of code that will only run if there is an option in that CameraModes list we made earlier to turn on an LED light. AudioVideoCaptureDevice flashLight; This creates an AudioVideoCaptureDevice object that I named flashLight, which I guess is a piece of code that essentially represents the entire camera. flashLight = await AudioVideoCaptureDevice.OpenAsync(camLocation, AudioVideoCaptureDevice.GetAvailableCaptureResolutions(camLocation).First()); I don’t know what this does. The guide says it “initialize[s] [the camera object] by fetching the Available Camera at the specified Camera Sensor Location.” I know that, because I used the await command, I actually had to change my button from a public to an async, uh, thing. I know that there is a video on this stuff here but I’m not going to watch it just now. flashLight.SetProperty(KnownCameraAudioVideoProperties.VideoTorchMode, VideoTorchMode.On); So this is the good stuff. After performing all of those steps, I finally get to turn the flashlight on. This code takes the flashLight object...

Read More

JttCotA: Part III – Setbacks and decionmaking

Posted by on Dec 10, 2013 in DGST101 Blogs |

So Windows Phone 7 doesn’t have an API for the back LED light, so if that means what I think what it means, I won’t be able to do anything with it. That’s pretty frustrating. I’ve always wanted to support as many devices and people as I possibly could, but it’s becoming apparent that that isn’t going to happen. There are a lot of hacks that people were able to develop back in the day, like repeatedly calling the function to turn on the Focus Assist Light, but honestly I’m not feeling particularly confident in my C# capabilities enough to do something like that. I think that I’m just going to have to support only Windows Phone 8, which is a whole new problem, because right now my app is being developed to be compatible with Windows Phone 7. Hilariously, I have no idea what this means. So what I’ve decided to do is just delete the project and start over. Good thing I haven’t really even done anything. I’ve figured out that I’m going to need a total of three files for this app: a XAML file for the main screen, a XAML file for the settings, and a C# file for the code. Right now I’m trying to work on the layout, which is awkward because there isn’t any code yet. For example, one of the issues that I’m having is trying to figure out the Opacity settings for my Application bar right now. The declaration for the bar asks for an Opacity setting, but I’m not sure if I can fill that in with a Variable, which would need to be taken from the C# code. I’m hoping that I can, but at the same time not having C# code to work with is not particularly helpful. I’m also wanting to my my emblem today. It’s supposed to just be a simple white outline of a sun, with a circle and little triangles radiating out from it. However, getting triangles that line up with the circle is something that is worrying me. I’m not even sure how to draw things like boxes in GIMP, so right now I’m working on it in MS Paint. I mean really, though, what could be better. I’m still struggling with coding quite a bit, though I think that, now that I’ve figured out the button controls, I should be ok. I think that the Settings page might give me a little bit of an issue, but I’m still not sure how all of that sort of thing works just yet. I considered having the settings just be a page you could swipe to instead of something that you needed to...

Read More

Texturize Your Photos In Only 5 Steps

Posted by on Dec 6, 2013 in DGST101 Blogs |

Step 1: Get a photo. Ex: a photo of the beautiful Charlie Prince. Step 2. Get a texture, you can find one online. Ex: this sandy wrinkled paper texture. Step 3. Place the texture, in another layer, over your image. Step 4: under the layer properties of the texture, choose SOFT LIGHT. Step 5: Adjust the opacity or the layers to your liking, and then save! Or add more layers, because sometimes one isn’t enough. Here is my final product for now. I’m just going to leave this here also… to learn how to make GIFs in 5 steps check...

Read More

10 Ways To Style Photos In Photoshop

Posted by on Dec 6, 2013 in DGST101 Blogs |

1. Photo with Gradient (Neutral Density) 2. Photo with Brightness/Contrast (Contrast 75) 3. Photo with Levels  (Removed R from RGB) 4. Photo with Exposure (Offset down: Exposure high) 5. Photo with Saturation (low) 6. Photo with Posterize 7. Photo with Midtones (Blue) 8. Photo with Black and White 9. Photo with Photo Filter (Orange) 10: Photo with Chanel Mixer (less...

Read More

7 reasons your internet habits are terrible

Posted by on Dec 6, 2013 in DGST101 Blogs |

All anybody needs to capture you attention is puppies. via amyoops Timmy just wants to look at cool pictures of his favorite Pokemon, Latias. And you ruin it. Your Fanfiction should never be seen by another human being. Much less all of them. Nobody needs another Skip Bayless. Stop talking about sports. via reddit The music you make is worse than anything Guns ‘N Roses ever made. Ever. via reddit You are constantly being manipulated by your computer screen into liking things more, simply because it’s so big. You just want to read lists all the...

Read More

New text adventure!

Posted by on Dec 6, 2013 in DGST101 Blogs |

I tried out Playfic.com to write a text adventure game that’s quite a bit different from one made using the Twine platform. In the playfic games, players are presented with different areas and objects to interact with and they have to a) choose which direction to travel in, b) collect items, and c) type commands to let the game know what to present next. When I first started using it, I used the tutorials on this page. They didn’t give you a step-by-step, you just had to look at “game source” to figure out how to create rooms/objects/etc. It was confusing to me, especially when I wanted to do something that wasn’t described in the tutorial, like give the player the choice to drink something instead of eat it. The concept was really interesting, though, so I struggled through and created a short game called The Surprise....

Read More

Photoshop Phriday

Posted by on Dec 5, 2013 in DGST101 Blogs |

Merging famous images Three images for Photoshop Phriday! AKA It’s probably a good idea to take photoshop away from me. Absinthe Drinkers in the Night Cafe  The setting is the Night Cafe by Vincent Van Gogh is a place where people of the night can take refuge. The drinkers on the left are from Edgar Degas L’Absinthe and at your right is the drinker from Edouard Manet’s The Absinthe Drinker.  Putti Watching the Abduction of Ganymede The setting is the Rape of Ganymede by Girolamo da Carpi , where Zeus is in the form of an eagle, taking a young Ganymede to Mount Olympus. The Putti from the Sistine Chapel, watch this strange event.  Mona Lisa and Child  The setting is the Mona Lisa by Davinci  and she she clothed in the drapery of the Byzantine Madonna and Child by Barnaba da Modena, consequently, she also has to hold the infant...

Read More
css.php