How to convert icon to bitmap in window phone? - windows-phone

Is there any way to convert icon(.ico) format to bitmap ?
I can not use
icon.ToBitmap
in window phone ?

Related

OS X Get string from standard system localized strings

I need to use a few strings in my project like a "Cancel", "Battery", "Apply", etc.
It is possible to get localized strings from system localized strings?
Example:
If OS language is German I need to get german-localized strings for my strings above.
Unfortunately, likely it's impossible. You need to localize all strings yourself, besides for example "Back button" or someone like that in iOS. UIKit has some amount of localized strings, but you don't have access to it.
Follow the below steps:-
1) Go to the Project Setting->Build Settings->Localization
2) Click on + button and choose German and then click on Finish button
3) Create new String file name as Localizable string (cmd+N)
4) Now inside that just add the key value like that below:-
5) Now wherever you want to display your value just access it like that using code:-
For example, you want to display in the textfield.
self.txt.stringValue=[NSString stringWithFormat:NSLocalizedString(#"cancel", nil)];

Vb.NET Insert Image File to Picturebox and store it to database.mdf

I have a table which have image data type in one of the colomn
, I try this code,
first, is this a right code to insert one row of the table?
Me.DatasiswaTableAdapter.Insert(NISTextBox.Text, NamaTextBox.Text, KelasTextBox.Text, JurusanTextBox.Text, Jenis_KelaminComboBox.Text, Tanggal_LahirDateTimePicker.ToString, AlamatRichTextBox.Text, FotoPictureBox.Image)
if yes then I need to know why the image type is change to byte? and
how to insert the image from picturebox if the format of the code is
a byte?
then if no please let me know the right code
Sorry for my bad English :)
Thanks
the net-informations link you posted should be very helpful if you study it.
it means a)the column you want to store the image to in SQL server must be defined as image. If you are using a different DB such as Access, depending on the version you might need to define it as Object or something similar. b) in the example, the image is converted to a stream (using image.save) then the stream to a byte array for storing in the DB.
you may want to store a bit more information about the image. getting it back to an image will just be the reverse (db -> byte array -> stream), but you are not going to know whether it was JPG, PNG, TIFF etc. If you think you will ever want to recreate it as a disk file in its original format, store the MIME type as well.

Export MFC CView into vectorial format

With my MFC application, I am able to print my CDocument on screen using the CView class.
Basically, I use the CDC class to write text and draw polygons on screen to provide a view representation of my document.
Now let's say I would like to use that output view in Microsoft Word.
From a user point a view and without anymore developer work, I can :
copy-paste my drawing to word : this produces a raster BMP file which I am able to paste in Word
print my drawing and use a PDF exporter : this produces a vectorial PDF file which is light and zoom-able, but not easy to reuse in Word.
These two effortless solutions are great because I can keep the exact layout of my view, but have cons (raster or format)
Another way to solve my problem would be to write SVG or VML but I would not get the same layout and this would require a lot of work.
Is there a library to do the same kind of PDF export / print mechanism into a standard format ?
What would you suggest ? Thanks a lot.
To draw your view into a Enhanced Meta File, first read the documentation # MSDN:
http://msdn.microsoft.com/en-us/library/427wezx1%28v=VS.80%29.aspx
Here is an example, how this works:
CMetaFileDC MFDC;
CRect rect(0,0,width,height);
MFDC.CreateEnhanced(NULL,NULL,rect,NULL);
MFDC.SetBkMode(TRANSPARENT);
MFDC.SetMapMode(MM_HIMETRIC);
CDC tempDC;
tempDC.CreateCompatibleDC(&MFDC);
MFDC.SetAttribDC(tempDC.m_hDC);
// now you draw into the DC like it was your original view
HENHMETAFILE hEnhMetaFile = MFDC.CloseEnhanced();
HENHMETAFILE hEMF = NULL;
hEMF = CopyEnhMetaFile(hEnhMetaFile,"C:\\Temp\\Test.emf");
DeleteEnhMetaFile(hEMF);
DeleteEnhMetaFile(hEnhMetaFile);

Displaying on label

I want to display some text means name of any source file with extension in a label. But the width is fixed and if the name is more than the width I want the name to be displayed like "Women Que...nnaire.jpg". Is it possible to display like this . If possible please let me know.
Set following in your label object:
adjustsFontSizeToFitWidth=NO;
lineBreakMode=NSLineBreakByTruncatingMiddle;
numberOfLines=1;
This is your answer;
Set :
lablel.adjustsFontSizeToFitWidth=YES;
Set Minimum font size of text;
lablel.minimumFontSize=10;// depends on you. How small font you want!
auto adjust size from label using this property using--
sizeToFit

Can qgraphicsscene be conveted to a pixmap?

I want to convert a QGraphicsScene to a pixmap, so I can add it to a listwidget as a QGraphicsPixmapItem. I wonder is it possible?
In another word, what I want to get is just like a thumb of a QGraphicsScene.
Yes, but not directly.
You can convert a QGraphicsView into a pixmap, using the static function QPixmap::grabWidget(). Create a graphics view, attach your scene to the view, and then convert the widget.