السلام عليكم
انا عندي مشروع لكني لم اعرف كيف سوف اعمل هذا الجزء ارجوا المساعدة
انا اريد ان اعمل interface بلغة ال c موجود فيه هذه الصورة واضع على كل باب مثلا كبسه عندما اضغط عليها يقوم بفتح الباب وهكذا
انا اريد كيف سوف اضع هذه الصورة مع كبسه على كل باب فقط
نعم هذه ما أقصد … أرى إن الرسمة غير مكتمله لا يوجد سويتشات ولايوجد شكل للخرج … هل هذه الرسمه للتمرين فقط على الميكروكنترولر (لغرض تعليمي) … لو الموضوع بهذا الشكل وليس للتنفيذ العملي … لا يوجد مشكله سأكتب لك الكود … فقط أخبرني هل هو موضوع تعليمي للتدريب أو هيه رسمه تريد تنفيذها على ارض الواقع
هذه الرسمة سوف تطبق على ارض الواقع لكني انا لا اريد ان ادخل في الميكروكنترولر برمجته انا اريد فقط برمجة الشاشة التي سوف اتعامل من خلالها مع الميكروكنترولر يعني كما شرحت سابقا شكل البيت وعلى كل باب كبسه فقط هذه الكبسه عندما اضغط عليها اما تعطيني off or on
شكرا
اها طالب جامعي … انا قمت بسؤال بعض الدكاتره انا لااريد تطبيقه على ارض الواقع اريد فقط الصورة وعليها الكبسات عندما اضغط عليها يخرج لي رسالة انه فتح الباب او اغلق فقط
السلام عليكم
هاد كود بعمل load لصورة اي بقرا صورة من نوع jpg لكن عند تنفيذه على visual c++ لا تظهر الصورة اي لا يقراها لكن يخرج المربع الذي يجب ان تظهر به الصوره لا اعلم اين الخطا احتاج المساعده ضروري جدا
// t.cpp : main project file.
#include "stdafx.h"
#include "Form1.h"
#using <mscorlib.dll> //requires CLI
using namespace System;
using namespace System::IO;
using namespace System::Windows::Media::Imaging;
using namespace System::Windows::Media;
using namespace System::Windows::Controls;
using namespace t;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Create the main window and run it
Application::Run(gcnew Form1());
// Open a Stream and decode a JPEG image
//ملاحظة مسار (امتداد) الصور هوC:/heart.jpg
Stream^ imageStreamSource = gcnewFileStream("C:\Users\SOSO\Desktop \a.jpg", FileMode::Open, FileAccess::Read, FileShare::Read);
JpegBitmapDecoder^ decoder = gcnewJpegBitmapDecoder(imageStreamSource, BitmapCreateOptions::PreservePixelFormat, BitmapCacheOption::Default);
BitmapSource^ bitmapSource = decoder->Frames[0];//< --mamybitmape
// Draw the Image
System::Windows::Controls::Image^ myImage = gcnewSystem::Windows::Controls::Image(); //<--- this image in the Form1 -------
//ابعاد الصورة
myImage->Source = bitmapSource;
myImage->Stretch = Stretch::None;
int width = 128;//العرض
int height = width;//الارتفاع=العرض
int stride = width / 8;
array<System::Byte>^ pixels = gcnew array<System::Byte>(height * stride);
// Define the image paletteo
BitmapPalette^ myPalette = BitmapPalettes::Halftone256;
// Creates a new empty image with the pre-defined palette.
BitmapSource^ image = BitmapSource::Create(width, height,96, 96,PixelFormats::Indexed1,myPalette,pixels,stride);
System::IO::FileStream^ stream = gcnewSystem::IO::FileStream("C:\Users\SOSO\Desktop \a.jpg", FileMode::Create);
JpegBitmapEncoder^ encoder = gcnewJpegBitmapEncoder();
TextBlock^ myTextBlock = gcnewSystem::Windows::Controls::TextBlock();
myTextBlock->Text = "Codec Author is: " + encoder->CodecInfo->Author->ToString();
encoder->FlipHorizontal = true;
encoder->FlipVertical = false;
encoder->QualityLevel = 30;
encoder->Rotation = Rotation::Rotate90;
encoder->Frames->Add(BitmapFrame::Create(image));
encoder->Save(stream);
return 0;
}
أخي الكريم هذا المنتدى خاص بالميكروكنترولر والبرامج الخاصه به أما هذا الذي تسأل فيه هو سوفت وير وتستطيع أن تسأل عنه في هذا المنتدى وستجد هناك من يساعدك http://www.almohandes.org/vb/f44/