/*! \brief Create a colour block from the individual red, green and blue values of * a colour. * \param [in] r The Red component. * \param [in] g The green component. * \param [in] b The blue component. * \param [in] model The colour model to use in this colour block. * \return An integer array containing the generated colour block. * * \note The red, green and blue values should be within the range 0-255 and this * method truncates them to ensure that they are. */ public static int [] AllocStandardColourBlock(int r, int g, int b, ColourModel model) { return(AllocStandardColourBlock((uint)((r & 0xff) << ColourTrans.RedShift | (g & 0xff) << ColourTrans.GreenShift | (b & 0xff) << ColourTrans.BlueShift), model)); }
public static Colour ColourModelToColour(ColourModel model) { var colour = new Colour { id = model.id, ColourName = model.ColourName }; return(colour); }
public static ColourModel ColourToColourModel(Colour model) { var colour = new ColourModel { id = model.id, ColourName = model.ColourName }; return(colour); }
/*! \brief Create a colour block from a palette entry. * \param [in] colour The colour as a palette entry in the form 0xBBGGRR00. * \return An integer array containing the generated colour block. */ public static int [] AllocStandardColourBlock(uint colour, ColourModel model) { int [] colour_block = new int [3]; // The Acorn User Interface Manual seems to have the red and blue values the wrong // way around. colour_block[0] = (int)colour; colour_block[1] = 0; colour_block[2] = (int)model; return(colour_block); }
public PartialViewResult Partial_GetAllColours() { ColourModel colour = new ColourModel(); //Get data from Db var allColoursDal = bll.BllGetAllDataTableFromDb(new Colours()); //Map class on class - return List<1st parameter method> DataStorePlace.allColoursModel = helpMethod.HandMapper(new ColourModel(), allColoursDal); //Here call a function for creating DropDownList DataStorePlace.AllColoursFromDb = helpMethod.MakeDropDownList(DataStorePlace.allColoursModel); colour.AllColoursFromDb = DataStorePlace.AllColoursFromDb; return(PartialView(colour)); }
public ActionResult Create(ColourModel model) { if (ModelState.IsValid) { colourService.Add(model); TempData["Success"] = $"{model.ColourName} colour Added !!"; return(RedirectToAction("Index")); } return(View(@"~\Views\Configuration\Colour\Create.cshtml")); }
/*! \brief Set the colour model used by the Colour Dialogue. * \param [in] colourModel Can be RGB, CMYK or HSV. * \return Nothing. */ public void SetColourModel(ColourModel colourModel) { int [] model_block = new int [2]; model_block[0] = 4; model_block[1] = (int)colourModel; // Prevent the GC from moving the memory while we use its address GCHandle pinned_array = GCHandle.Alloc(model_block, GCHandleType.Pinned); try { IntPtr raw_data_ptr = pinned_array.AddrOfPinnedObject(); MiscOp_SetR3(0, Method.SetColourModel, raw_data_ptr); } catch { throw; } finally { pinned_array.Free(); } }
public ActionResult Edit(ColourModel model) { try { if (ModelState.IsValid) { colourService.Update(model); TempData["Success"] = $"{model.ColourName} colour updated!!"; return(RedirectToAction("Index")); } TempData["Danger"] = $"Form error!!"; } catch (Exception ex) { TempData["Danger"] = $"Something went wrong {ex.Message}"; } return(View(@"~\Views\Configuration\Colour\Index.cshtml", model)); }
public long CreateEminity(EminitiesModel Model, VehicleTypeModel Model1, VehicleBrandsModel Model2, ColourModel Model3) { return(_Ser.CreateEminity(Model, Model1, Model2, Model3)); }
public int UpdateColour(ColourModel Model) { return(_Ser.UpdateColour(Model)); }
public int Createcolor(ColourModel Model) { return(_Ser.Createcolor(Model)); }