Posts

.net - C# how to change bitmap image color and apply anti-aliasing -

i working on flowchart making application , involves changing color of images transparency(png). i've been searching hours workarounds , it's either it's not i'm looking or can't make work. first, let me show codes , how it. removed parts of code unrelated question. this class "create" flowchart symbols. inherited label class because need text centered on symbols. use images in .png format located inside resources folder , change color according user wants. namespace pf2 { public class terminal : label { public void createterminal(int x) { this.width = 250; this.height = 100; this.name = "terminal" + x; this.autosize = false; bitmap resized = new bitmap(properties.resources.shapeterminal, new size(this.width, this.height)); this.image = globals.changecolor(resized, color.yellow); this.text = ...

c# - How to iterate through a list so that the last iteration step goes back to the first object? -

i have list of points form plane. want create edges between consecutive points , add them list. here code have: // points forming plate arraylist points = part.points; // number of points forming plate int pointcount = points.count; // create edges list<linesegment> edges = new list<linesegment>(); (int = 0; < pointcount - 1; i++) { // start , end points point start = points[i]; point end = points[i+1]; // create edge linesegment edge = new linesegment(start, end); // add edge list edges.add(edge); } it doesn't quite work because doesn't create last edge between last , first points on list. way correct it? make work if statement this: for (int = 0; < pointcount; i++) { // start , end points point start = points[i] point; point end; if (i == pointcount-1) end = points[0] point; else end = points[i+1] point; // rest of code here } but i'm sure there more elegant way it. in python start lo...

html - Enable ng-click on a popup (mapbox) -

first apologize poor english i'm working on map marker , popup declared mapboxgl, i'm trying put ng-click button of popup instantiated in controller mymap.on('touchstart', function (e) { var features = mymap.queryrenderedfeatures(e.point, { layers: ['points'] }); if (!features.length) { return; } console.log(features); var feature = features[0]; if(popup == undefined){ var html = '<div class="popup-info">'; html += "<h5>"+ feature.properties.type + "</h5>"; html += "<p>"+ feature.properties.description +"</p>"; html += '<button ng-click="gotocomment()">commentaires (' + nbcomment +') </button>'; html += "</div>"; html += '<a href="#" class=...

javascript - Highlight text using query value in Griddle table -

i have data in griddle table. entering search string through custom filter box. want highlight search string value in griddle columns . how possible ? want achieve in react <code>https://jsfiddle.net/julmot/buh9h2r8/"</code>

javascript - image slideshow using canvas HTML5 -

i trying create image slideshow using html5 canvas , little bit of javascript. problem following: slideshow works fading effect want first passing through image set, , after that, images drawn canvas without effect, , keeps going that. html: <canvas id="showcanvas" width='600' height='400'>canvas not supported</canvas> javascript: <script type="text/javascript"> var imagepaths = ["images/j0149014.jpg","images/j0149024.jpg","images/j0149029.jpg"]; var showcanvas = null; var showcanvasctx = null; var img = document.createelement("img"); var currentimage = 0; var revealtimer; window.onload = function (){ showcanvas = document.getelementbyid('showcanvas'); showcanvasctx = showcanvas.getcontext('2d'); img.setattribute('width','600'); img.setattribute(...

Jquery calculate months between 2 dates -

what achive if user puts in date 08/08/2016 08/09/2016 = 1 month 08/08/2016 01/09/2016 = 1 month 08/08/2016 30/08/2016 = 1 month so basicly if wants rent room 01/08/2016 30/08/2016 counts 1 month could me achive jquery? or point me start. please have @ code. please note while testing this; put date in "mm/dd/yyyy" format i.e. date format. hope you $(document).ready(function() { $("#calc").click(function() { var = $("#from").val(); var = $("#to").val(); var monthdifference = 0; if (from != "" && != "") { var fromdate = new date(from); var todate = new date(to); calculatemonths(fromdate, todate, monthdifference); } }); function calculatemonths(fromdate, todate, monthdifference) { if (fromdate < todate) { monthdifference++; fromdate.setmonth(fromdate.getmonth() + 1); calculatemonths(fromdate, todate, mon...

c - Memory allocation error (I think?) in a dynamically sized shopping list. -

i've included code below if kind enough complile see problem. i'm trying make dynamically allocated shopping list used pointers , memory allocation. the entries stored in 1d char array (seperated null pointers). arrays containing location of first character , entry length have been created in order navigate list. the code works small entries, when use list of large entries (e.g. 'adsjasdkasjdaksdj') code thinks length (strlen(message)) '110040'. me looks memory error i'm no computer scientist (more of amateur coder). tried extending memory allocated using realloc() problem persists.. appreciated! i've put code in loop take 10 entries testing purposes. #include <stdio.h> #include <stdlib.h> #include <string.h> int listentries = 0; int main(int argc, const char * argv[]) { //initial definition , allocation of memory. char *list; list = (char *)malloc(sizeof(char)); //allocates requested memory , returns pointer ...