Search Results

Search found 25888 results on 1036 pages for 'image map'.

Page 72/1036 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • Cannot create a neutral unit with a trigger

    - by Xitcod13
    I've been playing around with the starcraft UMS (Use map settings) for a while and usually i figure things out pretty quickly when im stuck. Alas not this time. I'm trying to place a neutral unit (player 12) using a trigger. It refuses to work. I'm using Scmdraft 2.0 as my editor (but i cant get it to work in other editors either) (all neutral units placed before the game starts are visible and all other triggers work fine. Also i created a text msg and it does displays it in-game so the trigger triggers ) For testing I created a trigger that looks like this: Player: neutral (i tried neutral players player 1 and all players as well) Condition: -always Action: -Create *1 Terran Medic* at '*location 022*' for *Neutral* (also tried neutral players) When I start the game nothing happens. Here is what I tried: I tried placing a start location for neutral player (player 12) I tried changing the owner under map properties of player 12 to neutral and computer from unused which was the default. Although it seems like it should be a common enough problem, I don't see it in any FAQ and I cant find anything about it when I Google it. Thanks in advance.

    Read the article

  • 3D terrain map with Hexagon Grids (XNA)

    - by Rob
    I'm working on a hobby project (I'm a web/backend developer by day) and I want to create a 3D Tile (terrain) engine. I'm using XNA, but I can use MonoGame, OpenGL, or straight DirectX, so the answer does not have to be XNA specific. I'm more looking for some high level advice on how to approach this problem. I know about creating height maps and such, there are thousands of references out there on the net for that, this is a bit more specific. I'm more concerned with is the approach to get a 3D hexagon tile grid out of my terrain (since the terrain, and all 3d objects, are basically triangles). The first approach I thought about is to basically draw the triangles on the screen in the following order (blue numbers) to give me the triangles for terrain (black triangles) and then make hexes out of the triangles (red hex). http://screencast.com/t/ebrH2g5V This approach seems complicated to me since i'm basically having to draw 4 different types of triangles. The next approach I thought of was to use the existing triangles like I did for a square grid and get my hexes from 6 triangles as follows http://screencast.com/t/w9b7qKzVJtb8 This seems like the easier approach to me since there are only 2 types of triangles (i would have to play with the heights and widths to get a "perfect" hexagon, but the idea is the same. So I'm looking for: 1) Any suggestions on which approach I should take, and why. 2) How would I translate mouse position to a hexagon grid position (especially when moving the camera around), for example in the second image if the mouse pointer were the green circle, how would I determine to highlight that hexagon and then translating that into grid coordinates (assuming it is 0,0)? 3) Any references, articles, books, etc - to get me going in the right direction. Note: I've done hex grid's and mouse-grid coordinate conversion before in 2d. looking for some pointers on how to do the same in 3d. The result I would like to achieve is something similar to the following: http :// www. youtube .com / watch?v=Ri92YkyC3fw (sorry about the youtube link, but it will only let me post 2 links in this post... same rep problem i mention below...) Thanks for any help! P.S. Sorry for not posting the images inline, I apparently don't have enough rep on this stack exchange site.

    Read the article

  • Burn bootable iso image to USB stick using dd: Won't boot (despite USB first in boot sequence)

    - by Nicolas Raoul
    I have installed Ubuntu on a Lenovo Thinkpad R500 2732, and I must update the BIOS. On the Lenovo website, I am offered this: BIOS Update Bootable CD for Windows 7 (32-bit, 64-bit), Vista (32-bit, 64-bit), XP - ThinkPad R500 I guess a bootable CD that would do a BIOS update is indeed what I need. (still wondering why it says "Windows" though... if it is bootable should not it be OS-agnostic?) Not wanting to waste a CD, I copied the image to my USB stick: sudo dd if=/home/nico/7yuj40uc.iso of=/dev/sdb1 bs=1M And rebooted, after making sure USB is first in the boot sequence. PROBLEM: It does not boot. Did I forget one step? Details about the iso image (readme): ls -lh 7yuj40uc.iso 25M file 7yuj40uc.iso /home/nico/7yuj40uc.iso: # ISO 9660 CD-ROM filesystem data '7YUJ40US ' (bootable) (Scroll to the right: it says "bootable") UNetbootin does not work because it is not a Linux image. Some people on the Internet advise to copy the content of the ISO and do other steps. This ISO has zero ISO content so it would not work. If I mount the ISO, I can see it contains zero files.

    Read the article

  • How can I mount dd image of a partition?

    - by Puneet Arora
    I created a dd image of a partition (containing an HFS+ FS) of one of my disks (and not the entire disk) a few days ago using the following command - dd conv=sync,noerror bs=8k if=/dev/sdc2 of=/path/to/img How can I mount it? I tried the following but it doesn't work - mount -o loop,ro -t hfsplus /path/to/img /path/to/mntDir It gives me mount: wrong fs type, bad option, bad superblock on /dev/loop1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so and dmesg | tail gives me - [5248455.568479] hfs: invalid secondary volume header [5248455.568494] hfs: unable to find HFS+ superblock [5248462.674836] hfs: invalid secondary volume header [5248462.674843] hfs: unable to find HFS+ superblock [5248550.672105] hfs: invalid secondary volume header [5248550.672115] hfs: unable to find HFS+ superblock [5248993.612026] hfs: unable to find HFS+ superblock [5248998.103385] hfs: unable to find HFS+ superblock [5249031.441359] hfs: unable to find HFS+ superblock [5249036.274864] hfs: unable to find HFS+ superblock Is there something wrong that I am doing? I tried searching on how to do this but all the results I get only talk about mounting a partition from within a full disk image, using the offset option with mount - none talk about the case where the image itself is that of a partition. Thanks. PS: I'm running 64bit Arch Linux, and the partition from the original disk /dev/sdc2 mounts fine.

    Read the article

  • How can I pass a raw System.Drawing.Image to an .ashx?

    - by Mike C
    I am developing an application that stores images as Base64 strings in xml files. I also want to allow the user to crop the image before saving it to the file, preferably all in memory without having to save a temp file, and then delete it afterwards. In order to display the newly uploaded image, I need to create a HTTP handler that I can bind the asp:Image to. The only examples for doing this online require passing the .ashx an ID and then pulling the image from a DB or other data store. Is it possible to somehow pass the raw data to the .ashx in order to get back the image? Thanks, Mike

    Read the article

  • How come this image won't resize to fit the sprite?

    - by George Edison
    I have this snippet of ActionScript code that is supposed to resize an image to fit the sprite: package { import flash.display.Sprite; import flash.display.Bitmap; import flash.events.Event; public class Main extends Sprite { [Embed(source = 'img.png')] private var TheImage:Class; public static const TheImageWidth:Number = 1300; public static const TheImageHeight:Number = 1300; public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); // entry point var image:Bitmap = new TheImage(); addChild(image); image.scaleX = width / TheImageWidth; image.scaleY = height / TheImageHeight; } } } Why isn't it working?

    Read the article

  • PHP: Grab an image from a stream (in an img tag) but if it's not there, i don't want the img tag wri

    - by Gary Willoughby
    I currently have code like this in a web based file called 'view_file.php' to grab an image from an internal network. <img src="put_file.php?type=<?=$TN_TYPE;?>&path=<?=$TN_PATH;?>&filename=<?=$TN_FILENAME;?>" /> The 'put_file.php' script allows access to an internal server that we don't want to expose to the internet. This script checks to see if an image is available and if it is, sends an image header and then uses readfile() to stream the image to the 'view_file.php' page. The problem is if there isn't an image available, instead of streaming a temporary 'spacer.gif' i want to not have the img tag written at all. Any Ideas how to do this? I'm thinking maybe move the img tag into the 'put_file.php' script, but how to mix strings and steams?

    Read the article

  • How to find image width and height dynamically and specify height, width attibutes if over certain d

    - by Wbdvlpr
    Hi, I display some data on my website and one of the data feed elements is an image. [title] => Product title [description] => some description [image] => www.some-domain.com/product-image/p12345.jpg I then display this image using <img alt="product" src="<?=$data['image']?>" /> Most of the images are 80x80, 120x100 or other less than 150 in width, which perfectly fit in the website template, but some of them are quite large such as 800x600 which distort the layout. I want a control on these types. I tried to set WIDTH="150", but as the width vary they dont look good. I was thinking If I could set a fixed width to images, say, larger than 250px then I can live with it for now. Any ideas how to achieve this? Thanks

    Read the article

  • Bandpass filter of FFT applied image. (Like ImageJ bandpass filter algorithm)

    - by maximus
    There is a good function that I need, which is implemented in Java program: ImageJ I need to understand the algorithm used there. The function has several parameters: link text And before using FFT it converts image to a special one: The Bandpass Filter uses a special algorithm to reduce edge artifacts (before the Fourier transform, the image is extended in size by attaching mirrored copies of image parts outside the original image, thus no jumps occur at the edges) Can you tell me more about this special transform? Actually tiling mirrored image. I am writing on C++ and wish to rewrite that part of the program on C++.

    Read the article

  • what is the format of a binary image & how is it different from jpg, png images?

    - by Rahulsingh190
    I searched the internet for the basic formats of image files (e.g. .jpg, .png, .gif) as there is a specific format for .doc, .pdf etc. But didn't got anything relevant. And today I also came with an .bin image format. BIN signifies that the image is in the Binary format. So, what is the Internal format of .jpg image file. And How is it different from .bin (Binary) format. Because everything is Basically saved in Binary Form. And How is BITMAP Image different from .jpg format.

    Read the article

  • When does it makes sense to use a map?

    - by kiwicptn
    I am trying to round up cases when it makes sense to use a map (set of key-value entries). So far I have five categories (see below). Assuming more exist, what are they? Please limit each answer to one unique category, put up an example, and vote up the fascinating ones. Property values (like a bean) age -> 30 sex -> male loc -> calgary Histograms peter -> 1 john -> 7 paul -> 5 Presence, with O(1) performance peter -> 1 john -> 1 paul -> 1 Functions peter -> treatPeter() john -> dealWithJohn() paul -> managePaul() Conversion peter -> pierre john -> jean paul -> paul

    Read the article

  • What is my error in a map in java?

    - by amveg
    Hello everyone I am trying to solve this problem: http://www.cstutoringcenter.com/problems/problems.php?id=4, but I cant figure out why my code doesnt solve this, I mean in the "for" how can I can multiply the letters? what is my error?, It just tell always 7, but I want to multiple all the letters, I hope you can help me enter code here public class ejercicio3 { public static void main(String args[]) { Map<Character, Integer> telefono = new HashMap<Character, Integer>(); telefono.put('A', 2); telefono.put('B', 2); telefono.put('C', 2); telefono.put('D', 3); telefono.put('E', 3); telefono.put('F', 3); telefono.put('G', 4); telefono.put('H', 4); telefono.put('I', 4); telefono.put('J', 5); telefono.put('K', 5); telefono.put('L', 5); telefono.put('M', 6); telefono.put('N', 6); telefono.put('O', 6); telefono.put('P', 7); telefono.put('R', 7); telefono.put('S', 7); telefono.put('T', 8); telefono.put('U', 8); telefono.put('V', 8); telefono.put('W', 9); telefono.put('X', 9); telefono.put('Y', 9); String mensaje = "Practice"; int producto = 1; for (char c : mensaje.toCharArray()) { if (telefono.containsKey(c)) { producto = telefono.get(c) * producto; System.out.println(producto); } } } }

    Read the article

  • Can't access a map member from a pointer

    - by fjfnaranjo
    Hi. That's my first question :) I'm storing the configuration of my program in a Group->Key->Value form, like the old INIs. I'm storing the information in a pair of structures. First one, I'm using a std::map with string+ptr for the groups info (the group name in the string key). The second std::map value is a pointer to the sencond structure, a std::list of std::maps, with the finish Key->Value pairs. The Key-Value pairs structure is created dynamically, so the config structure is: std::map< std::string , std::list< std::map<std::string,std::string> >* > lv1; Well, I'm trying to implement two methods to check the existence of data in the internal config. The first one, check the existence of a group in the structure: bool isConfigLv1(std::string); bool ConfigManager::isConfigLv1(std::string s) { return !(lv1.find(s)==lv1.end()); } The second method, is making me crazy... It check the existence for a key inside a group. bool isConfigLv2(std::string,std::string); bool ConfigManager::isConfigLv2(std::string s,std::string d) { if(!isConfigLv1(s)) return false; std::map< std::string , std::list< std::map<std::string,std::string> >* >::iterator it; std::list< std::map<std::string,std::string> >* keyValue; std::list< std::map<std::string,std::string> >::iterator keyValueIt; it = lv1.find(s); keyValue = (*it).second; for ( keyValueIt = keyValue->begin() ; keyValueIt != keyValue->end() ; keyValueIt++ ) if(!((*keyValueIt).second.find(d)==(*keyValueIt).second.end())) return true; return false; } I don't understand what is wrong. The compiler says: ConfigManager.cpp||In member function ‘bool ConfigManager::isConfigLv2(std::string, std::string)’:| ConfigManager.cpp|(line over return true)|error: ‘class std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >’ has no member named ‘second’| But it has to have the second member, because it's a map iterator... Any suggestion about what's happening? Sorry for my English :P, and consider I'm doing it as a exercise, I know there are a lot of cool configuration managers.

    Read the article

  • How to map an IDictionary<String, CustomCollectionType> in NHibernate

    - by devonlazarus
    Very close to what I'm trying to do but not quite the answer I think I'm looking for: How to map IDictionary<string, Entity> in Fluent NHibernate I'm trying to implement an IDictionary<String, IList<MyEntity>>and map this collection to the database using NHibernate. I do understand that you cannot map collections of collections directly in NHibernate, but I do need the functionality of accessing an ordered list of elements by key. I've implemented IUserCollectionType for my IList<MyEntity> so that I can use IDictionary<String, MyCustomCollectionType> but am struggling with how to get the map to work as I'd like. Details This is the database I'm trying to model: ------------------------ -------------------- | EntityAttributes | | Entities | ------------------------ ------------------ -------------------- | EntityAttributeId PK | | Attributes | | EntityId PK | <- | EntityId FK | ------------------ | DateCreated | | AttributeId FK | -> | AttributeId PK | -------------------- | AttributeValue | | AttributeName | ------------------------ ------------------ Here are my domain classes: public class Entity { public virtual Int32 Id { get; private set; } public virtual DateTime DateCreated { get; private set; } ... } public class EavEntity : Entity { public virtual IDictionary<String, EavEntityAttributeList> Attributes { get; protected set; } ... } public class EavAttribute : Entity { public virtual String Name { get; set; } ... } public class EavEntityAttribute : Entity { public virtual EavEntity EavEntity { get; private set; } public virtual EavAttribute EavAttribute { get; private set; } public virtual Object AttributeValue { get; set; } ... } public class EavEntityAttributeList : List<EavEntityAttribute> { } I've also implemented the NH-specific custom collection classes IUserCollectionType and PersistentList And here is my mapping so far: <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" ...> <class xmlns="urn:nhibernate-mapping-2.2" name="EavEntity" table="Entities"> <id name="Id" type="System.Int32"> <column name="EntityId" /> <generator class="identity" /> </id> ... <map cascade="all-delete-orphan" collection-type="EavEntityAttributeListType" name="EntityAttributes"> <key> <column name="EntityId" /> </key> <index type="System.String"> <column name="Name" /> </index> <one-to-many class="EavEntityAttributeList" /> </map> </class> </hibernate-mapping> I know the <map> tag is partially correct, but I'm not sure how to get NH to utilize my IUserCollectionType to persist the model to the database. What I'd like to see (and this isn't right, I know) is something like: <map cascade="all-delete-orphan" collection-type="EavEntityAttributeListType" name="EntityAttributes"> <key> <column name="EntityId" /> </key> <index type="System.String"> <column name="Name" /> </index> <list> <index column="DisplayOrder"> <one-to-many class="EntityAttributes"> </list> </map> Does anyone have any suggestions on how to properly map that IDictionary<String, EavEntityAttributeList> collection? I am using Fluent NH so I'll take examples using that library, but I'm hand mappings are just as helpful here.

    Read the article

  • C# WinForms problem with draw image

    - by Paul
    Hi I have this class: class OriginalImage: Form { private Image image; private PictureBox pb; public OriginalImage() { pb = new PictureBox {SizeMode = PictureBoxSizeMode.CenterImage}; pb.SizeMode = PictureBoxSizeMode.StretchImage; Controls.Add(pb); image = Image.FromFile(@"Image/original.jpg"); this.Width = image.Width; this.Height = image.Height; this.Text = "Original image"; this.Paint += new PaintEventHandler(Drawer); } public virtual void Drawer(object source, PaintEventArgs e) { Graphics g = pb.CreateGraphics(); g.DrawImage(image,0,0); } I call this create object OriginalImage in other form on button click, but image is not draw? Where is problem? public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { var oi = new OriginalImage(); oi.Show(); } }

    Read the article

  • How to crop Image in iPhone?

    - by aman-gupta
    Hi, In my application I m using following codes to crop the captured image :- -(void)imagePickerController:(UIImagePickerController *) picker didFinishPickingMediaWithInfo:(NSDictionary *)info { #ifdef _DEBUG NSLog(@"frmSkinImage-imagePickerController-Start"); #endif imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; //======================================= UIImage *image =imageView.image; CGRect cropRect = CGRectMake(100, 100, 125,128); CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], cropRect); [imageView setImage:[UIImage imageWithCGImage:imageRef]]; CGImageRelease(imageRef); //=================================================== //imgglobal = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; // for saving image to photo album //UIImageWriteToSavedPhotosAlbum(imageView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), self); [picker dismissModalViewControllerAnimated:YES]; #ifdef _DEBUG NSLog(@"frmSkinImage-imagePickerController-End"); #endif } But my problem is that when I use camera to take photo to crop the captured image it rotates the image to 90 degree towards right and in case I use Photo library it works perfectly. So Can u filter my above codes to know where I m wrong. Please help me out its urgent Thanks In Advance

    Read the article

  • Problem in cropping the UIImage using CGContext?

    - by Rajendra Bhole
    Hi, I developing the simple UIApplication in which i want to crop the UIImage (in .jpg format) with help of CGContext. The developed code till now as follows, CGImageRef graphicOriginalImage = [originalImage.image CGImage]; UIGraphicsBeginImageContext(originalImage.image.size); CGContextRef ctx = UIGraphicsGetCurrentContext(); CGBitmapContextCreateImage(graphicOriginalImage); CGFloat fltW = originalImage.image.size.width; CGFloat fltH = originalImage.image.size.height; CGFloat X = round(fltW/4); CGFloat Y =round(fltH/4); CGFloat width = round(X + (fltW/2)); CGFloat height = round(Y + (fltH/2)); CGContextTranslateCTM(ctx, 0, image.size.height); CGContextScaleCTM(ctx, 1.0, -1.0); CGRect rect = CGRectMake(X,Y ,width ,height); CGContextDrawImage(ctx, rect, graphicOriginalImage); croppedImage = UIGraphicsGetImageFromCurrentImageContext(); return croppedImage; } The above code is worked fine but it can't crop image. The original image memory and cropped image memory i will got same(equal to original image memory). The above code is right for cropping the image?????????????????? How i cropping the image (in behind pixels should also be crop) from the center of the image???????????? I already wasting a lot of time for developing the above code , but i didn't get answer or way to find out how to crop the image.Thanks for sending me answer in advanced.

    Read the article

  • Where to delete model image?

    - by WesDec
    I have a Model with an image field and I want to be able to change the image using a ModelForm. When changing the image, the old image should be deleted and replaced by the new image. I have tried to do this in the clean method of the ModelForm like this: def clean(self): cleaned_data = super(ModelForm, self).clean() old_profile_image = self.instance.image if old_profile_image: old_profile_image.delete(save=False) return cleaned_data This works fine unless the file indicated by the user is not correct (for example if its not an image), which result in the image being deleted without any new images being saved. I would like to know where is the best place to delete the old image? By this I mean where can I be sure that the new image is correct before deleting the old one?

    Read the article

  • Where can I find a professional image gallery built on a javascript framework?

    - by user278457
    I'm looking to find a galleria replacement, hopefully using jQuery but other javascript frameworks such as prototype or mootools are fine too. I used galleria a while back, and I need a similar product now. Unfortunately, the devkick.com domain seems to have disappeared in the meantime and I'm wary of using products that aren't actively maintained. I'm willing to pay up to $50 per site for licensing costs, if the product meets my needs. I'm specifically looking for a gallery with the following features: Every image in the gallery preloads asap, not as the user clicks "next" Minimalist default css to keep my subsequent styling headaches down, preferably a "darkroom" style by default, much as galleria looks Each element that constructs the image gallery should be simple and logical to reference with CSS As easy to install as adding a css class to a single unordered list No dependencies other than the core jQuery/other library, including "easing" and other effects must be optional Works on browsers back to IE6, Firefox 3, Safari (and iPhone), Chrome, Opera Has a javascript API that lets me trigger callback functions on common events such as "user clicks next" or "image loads" degrades gracefully without javascript, either displays images as a list, or just displays the first image in the list bonus: The gallery can display other content, such as video or external sites, like the modal boxes at shadowbox-js.com well documented minimal bandwidth requirement - .js file should be ~10kb minified bonus: The gallery source is hosted on a reliable CDN like google's bonus: Thumbnails for images do not appear until the main image has loaded bonus: includes ability to set parameters with JSON to change common behaviours, such as slide/fade transitions or automatic image switch every X seconds

    Read the article

  • Assemble an image browser side with JavaScript or Flash?

    - by Kris Walker
    Would it be possible to assemble an image on the browser by 'concatenating' other downloaded images together? The use case is this. The page will display 36 different tiles (small images). The user should be able to arrange those tiles into a 6 x 6 grid and save the resulting grid to disk as an image. The best solution would be to do it all in the browser without Flash. The next best solution would be to allow the user to create the grid in the browser with simple JavaScript drag and drop functionality and then send the coordinates to the server for image processing. The last solution would be to do it all in the browser with Flash. Is it even possible for Flash to create an image and then allow the user to save it from the browser? I am familiar with the Pixastic JavaScript library ( http://www.pixastic.com/ ), but it relies on getting image data to and from a canvas element which is not very well supported. What if I send the tile images to the browser as base64 encoded strings? Could I use JavaScript to create the 6 x 6 grid image? And if so, is there some way of allowing the user to get it onto disk without relying on the canvas element?

    Read the article

  • Making only part of an image a hot spot link.

    - by Rkstarcass
    I have a large image and only want a rectangle portion of it to be a hot spot link that goes "Home". Here is my code that is not working. Any help on what I am missing or have done wrong? Thanks! <div id="defaultPic" runat="server"> <img src="Images/boardwise-home.jpg" alt="Boardwise Home" usemap="#map" /> <map name="map" id="boardwise-home"> <area shape="rect" coords="32,23,32,105,275,105,275,23" href="~/default.aspx" title="Boardwise Home" alt="Home" /> </map>

    Read the article

  • C# Image.Clone to byte[] causes EDIT.COM to open on Windows XP

    - by JayDial
    It appears that cloning a Image and converting it to a byte array is causing EDIT.COM to open up on Windows XP machines. This does not happen on a Windows 7 machine. The application is a C# .NET 2.0 application. Does anyone have any idea why this may be happening? Here is my Image conversion code: public static byte[] CovertImageToByteArray(Image imageToConvert) { imageToConvert.Clone() as Image; if(clone == null) return null; imageToConvert.Dispose(); byte[] imageByteArray; using (MemoryStream ms = new MemoryStream()) { clone.Save(ms, clone.RawFormat); imageByteArray = ms.ToArray(); } return imageByteArray; } public static Image ConvertByteArrayToImage(byte[] imageByteArray, ImageFormat formatOfImage) { Image image; using ( MemoryStream ms = new MemoryStream(imageByteArray, 0, imageByteArray.Length)) { ms.Write(imageByteArray, 0, imageByteArray.Length); image = Image.FromStream(ms, true); } return image; } Thanks Justin

    Read the article

  • Image animation problem in silverlight

    - by Jak
    Hi followed " http://www.switchonthecode.com/tutorials/silverlight-3-tutorial-planeprojection-and-perspective-3d#comment-4688 ".. the animation is working fine. I am new to silver light. when i use dynamic image from xml instead of static image as in tutorial,.. it is not working fine, please help me on this. i used list box.. for this animation effect do i need to change listbox to some other arrangement ? if your answer yes means, pls give me some sample code. Thanks in advance. Xaml code: <ListBox Name="listBox1"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <Image Source="{Binding imgurl}" HorizontalAlignment="Left" Name="image1" Stretch="Fill" VerticalAlignment="Top" MouseLeftButtonUp="FlipImage" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> My C# code: //getting image URL from xml XElement xmlads = XElement.Parse(e.Result); //i bind the url in to listBox listBox1.ItemsSource = from ads in xmlads.Descendants("ad") select new zestItem { imgurl = ads.Element("picture").Value }; public class zestItem { public string imgurl { get; set; } } private int _zIndex = 10; private void FlipImage(object sender, MouseButtonEventArgs e) { Image image = sender as Image; // Make sure the image is on top of all other images. image.SetValue(Canvas.ZIndexProperty, _zIndex++); // Create the storyboard. Storyboard flip = new Storyboard(); // Create animation and set the duration to 1 second. DoubleAnimation animation = new DoubleAnimation() { Duration = new TimeSpan(0, 0, 1) }; // Add the animation to the storyboard. flip.Children.Add(animation); // Create a projection for the image if it doesn't have one. if (image.Projection == null) { // Set the center of rotation to -0.01, which will put a little space // between the images when they're flipped. image.Projection = new PlaneProjection() { CenterOfRotationX = -0.01 }; } PlaneProjection projection = image.Projection as PlaneProjection; // Set the from and to properties based on the current flip direction of // the image. if (projection.RotationY == 0) { animation.To = 180; } else { animation.From = 180; animation.To = 0; } // Tell the animation to animation the image's PlaneProjection object. Storyboard.SetTarget(animation, projection); // Tell the animation to animation the RotationYProperty. Storyboard.SetTargetProperty(animation, new PropertyPath(PlaneProjection.RotationYProperty)); flip.Begin(); }

    Read the article

  • Why would an image (the Mandelbrot) be skewed and wrap around?

    - by Sean D
    So I just wrote a little snippet to generate the Mandelbrot fractal and imagine my surprise when it came out all ugly and skewed (as you can see at the bottom). I'd appreciate a point in the direction of why this would even happen. It's a learning experience and I'm not looking for anyone to do it for me, but I'm kinda at a dead end debugging it. The offending generation code is: module Mandelbrot where import Complex import Image main = writeFile "mb.ppm" $ imageMB 1000 mandelbrotPixel x y = mb (x:+y) (0:+0) 0 mb c x iter | magnitude x > 2 = iter | iter >= 255 = 255 | otherwise = mb c (c+q^2) (iter+1) where q = x --Mandelbrot --q = (abs.realPart $ x) :+ (abs.imagPart $ x) --Burning Ship argandPlane x0 x1 y0 y1 width height = [(x,y)| y<-[y1,(y1-dy)..y0], --traverse from x<-[x0,(x0+dx)..x1]] --top-left to bottom-right where dx = (x1 - x0)/width dy = (y1 - y0)/height drawPicture :: (a->b->c)->(c->Colour)->[(a,b)]->Image drawPicture function colourFunction plane = map (colourFunction.uncurry function) plane imageMB s = createPPM s s $ drawPicture mandelbrotPixel (\x->[x,x,x]) $ argandPlane (-1.8) (-1.7) (0.02) 0.055 s' s' where s' = fromIntegral s And the image code (which I'm fairly confident in) is: module Image where type Colour = [Int] type Image = [Colour] createPPM :: Int -> Int -> Image -> String createPPM w h i = concat ["P3 ", show w, " ", show h, " 255\n", unlines.map (unwords.map show) $ i]

    Read the article

  • Using ManualResetEvent to wait for multiple Image.ImageOpened events

    - by umlgorithm
    Dictionary<Image, ManualResetEvent> waitHandleMap = new Dictionary<Image, ManualResetEvent>(); List<Image> images = GetImagesWhichAreAlreadyInVisualTree(); foreach (var image in images) { image.Source = new BitmapImage(new Uri("some_valid_image_url")); waitHandleMap.Add(image, new ManualResetEvent(false)); image.ImageOpened += delegate { waitHandleMap[image].Set(); }; image.ImageFailed += delegate { waitHandleMap[image].Set(); }; } WaitHandle.WaitAll(waitHandleMap.Values.ToArray()); WaitHandle.WaitAll blocks the current UI thread, so ImageOpened/ImageFailed events would never get fired. Could you suggest me an easy workaround to wait for the multiple ui events?

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >